Skip to content

Update non-production code to fix specs against Rails edge #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,4 @@ rails =

gem 'rails', rails

# Required for Rails 6.1.x with Ruby 3.1+
if RUBY_VERSION >= '3.1'
gem 'net-smtp', require: false
gem 'net-imap', require: false
gem 'net-pop', require: false
end


gemspec
2 changes: 1 addition & 1 deletion jsonapi-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rails', '>= 5.0'
spec.add_development_dependency 'sqlite3', '>= 1.3'
spec.add_development_dependency 'rake', '>= 11.3'
spec.add_development_dependency 'rspec-rails', '~> 3.5'
spec.add_development_dependency 'rspec-rails', '>= 4.0'
spec.add_development_dependency 'with_model', '~> 2.0'
spec.add_development_dependency 'simplecov'
end
9 changes: 6 additions & 3 deletions spec/deserialization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def create
it 'makes the deserialized resource available in params' do
post :create, params: payload

expected = { 'type' => 'users', 'name' => 'Lucas' }
expected = ActionController::Parameters.new('type' => 'users',
'name' => 'Lucas')
expect(controller.params[:user]).to eq(expected)
end

Expand Down Expand Up @@ -54,7 +55,8 @@ def create
it 'makes the deserialized resource available in params' do
post :create, params: payload

expected = { 'type' => 'users', 'first_name' => 'Lucas' }
expected = ActionController::Parameters.new('type' => 'users',
'first_name' => 'Lucas')
expect(controller.params[:user]).to eq(expected)
end

Expand All @@ -81,7 +83,8 @@ def create
it 'makes the deserialized resource available in params' do
post :create, params: payload

expected = { 'type' => 'users', 'Name' => 'Lucas' }
expected = ActionController::Parameters.new('type' => 'users',
'Name' => 'Lucas')
expect(controller.params[:user]).to eq(expected)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/render_jsonapi_errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
'errors' => [
{
'detail' => 'Name can\'t be blank',
'detail' => "Name #{I18n.t('errors.messages.blank')}",
'title' => 'Invalid name',
'source' => { 'pointer' => '/data/attributes/name' }
},
Expand Down Expand Up @@ -64,7 +64,7 @@ def jsonapi_pointers
def create
errors = [
{
detail: 'Name can\'t be blank',
detail: "Name #{I18n.t('errors.messages.blank')}",
title: 'Invalid name',
source: { pointer: '/data/attributes/name' }
},
Expand Down