Skip to content

Commit

Permalink
[CI] test against Rails 7.1 (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
markets authored Oct 30, 2023
1 parent 307e1d4 commit cee6fdf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2"]
gemfile: [rails_6.0, rails_6.1, rails_7.0]
gemfile: [rails_6.0, rails_6.1, rails_7.0, rails_7.1]
exclude:
- ruby: "3.1"
gemfile: rails_6.0
Expand Down
1 change: 1 addition & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%w(
7.1
7.0
6.1
6.0
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 7.1.0"

gemspec path: "../"
12 changes: 6 additions & 6 deletions spec/controllers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def custom_timestamp_callback
}

expect(flash[:error]).not_to be_present
expect(response.body).to be_present
expect(response.body).to redirect_to(new_topic_path)

# Make sure session is cleared
expect(session[:invisible_captcha_timestamp]).to be_nil
Expand All @@ -96,7 +96,7 @@ def custom_timestamp_callback
post :publish, params: { id: 1 }

expect(flash[:error]).not_to be_present
expect(response.body).to be_present
expect(response.body).to redirect_to(new_topic_path)
end
end
end
Expand Down Expand Up @@ -126,27 +126,27 @@ def custom_timestamp_callback
it 'passes with no spam' do
post :categorize, params: { topic: { title: 'foo' } }

expect(response.body).to be_present
expect(response.body).to redirect_to(new_topic_path)
end

it 'fails with spam' do
post :categorize, params: { topic: { "#{InvisibleCaptcha.honeypots.sample}": 'foo' } }

expect(response.body).to be_blank
expect(response.body).not_to redirect_to(new_topic_path)
end
end

context 'with no scope' do
it 'passes with no spam' do
post :categorize

expect(response.body).to be_present
expect(response.body).to redirect_to(new_topic_path)
end

it 'fails with spam' do
post :categorize, params: { "#{InvisibleCaptcha.honeypots.sample}": 'foo' }

expect(response.body).to be_blank
expect(response.body).not_to redirect_to(new_topic_path)
end
end

Expand Down

0 comments on commit cee6fdf

Please sign in to comment.