Skip to content

Commit

Permalink
chore: add tests and update dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Nov 2, 2023
1 parent 97ae843 commit 2626310
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/gemfiles/
/pkg/
/spec/reports/
/spec/internal/tmp/
/tmp/
.pry_history
.rspec_status
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
ruby:
image: ruby:${RUBY_IMAGE:-3.0}-buster
image: ruby:${RUBY_IMAGE:-3.2}-bookworm
environment:
HISTFILE: /app/.bash_history
BUNDLE_PATH: /bundle
Expand Down
2 changes: 1 addition & 1 deletion graphql-connections.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "pg", "~> 1.2"
spec.add_development_dependency "pry-byebug", "~> 3"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec-rails", "~> 5.0"
spec.add_development_dependency "rspec-rails", "~> 6.0"
spec.add_development_dependency "standard", "~> 1.1"
spec.add_development_dependency "test-prof", "~> 1.0"
end
Expand Down
2 changes: 1 addition & 1 deletion lefthook-local.dip_example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pre-commit:
commands:
rubocop:
runner: dip {cmd}
run: dip {cmd}
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pre-commit:
rubocop:
tags: backend
glob: "**/*.rb"
runner: bundle exec standardrb --fix {staged_files} && git add {staged_files}
run: bundle exec standardrb --fix {staged_files} && git add {staged_files}
10 changes: 10 additions & 0 deletions spec/lib/keyset/desc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
expect(connection.has_previous_page).to be false
expect(connection.has_next_page).to be true
end

context "with empty relation" do
let(:relation) { Message.none }

it "returns no nodes and has_previous_page and has_next_page are false" do
expect(nodes.size).to eq 0
expect(connection.has_previous_page).to be false
expect(connection.has_next_page).to be false
end
end
end

describe ":first param" do
Expand Down
10 changes: 10 additions & 0 deletions spec/lib/primary_key/asc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
expect(connection.has_previous_page).to be false
expect(connection.has_next_page).to be true
end

context "with empty relation" do
let(:relation) { Message.none }

it "returns no nodes and has_previous_page and has_next_page are false" do
expect(nodes.size).to eq 0
expect(connection.has_previous_page).to be false
expect(connection.has_next_page).to be false
end
end
end

describe ":first param" do
Expand Down

0 comments on commit 2626310

Please sign in to comment.