Skip to content

Commit

Permalink
Add Gemfile to test with Rails 7.0 and fix the test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
kiskoza committed Feb 26, 2023
1 parent 8f10e19 commit eadd462
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ coverage/*
.tool-versions

spec/gemfiles/*.lock
.byebug_history
14 changes: 14 additions & 0 deletions spec/gemfiles/Gemfile.rails-7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source "http://rubygems.org"

gemspec path: '../../'

gem 'rails', "~> 7.0.0"
gem 'responders', '~> 3.0'
gem 'sqlite3'
gem 'sprockets', '~> 3.0'
gem "jquery-rails"
gem "thin"
gem 'capybara', '~> 2.1'
gem 'acts_as_caxlsx', git: 'https://github.com/caxlsx/acts_as_caxlsx.git'

gem 'byebug'
6 changes: 5 additions & 1 deletion spec/rails_app/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def index
def show
@user = User.find(params[:id])
respond_with(@user) do |format|
format.xlsx { render "respond_with.xlsx.axlsx" }
if Gem::Version.new("7.0") <= Rails.gem_version
format.xlsx { render "respond_with" }
else
format.xlsx { render "respond_with.xlsx.axlsx" }
end
end
end

Expand Down

0 comments on commit eadd462

Please sign in to comment.