diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index eeb091f4..0ef0f056 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -9,7 +9,7 @@ before(:each){ get :root, format: :json } it 'should render json' do - expect(response.content_type).to eql 'application/json' + expect(response.media_type).to eql 'application/json' end it 'should list resources' do @@ -21,7 +21,7 @@ before(:each){ get :root, format: :json_api } it 'should render json' do - expect(response.content_type).to eql 'application/json' + expect(response.media_type).to eql 'application/json' end it 'should list resources' do @@ -36,7 +36,7 @@ end it 'should render html' do - expect(response.content_type).to eql 'text/html' + expect(response.media_type).to eql 'text/html' end it 'should redirect' do diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 26ab3f44..9332e919 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -140,7 +140,7 @@ end it 'should be json' do - expect(response.content_type).to eql 'application/json' + expect(response.media_type).to eql 'application/json' end it 'should be an object' do diff --git a/spec/support/shared_examples_for_controller_actions.rb b/spec/support/shared_examples_for_controller_actions.rb index e79616ff..366c66e9 100644 --- a/spec/support/shared_examples_for_controller_actions.rb +++ b/spec/support/shared_examples_for_controller_actions.rb @@ -19,7 +19,7 @@ it 'should be json' do # starting from Rails 5+, if responding with 204, content-type of response is set by Rails as nil - expect(response.content_type).to eql 'application/json' unless response.status == 204 + expect(response.media_type).to eql 'application/json' unless response.status == 204 end it 'should be an object' do diff --git a/spec/support/shared_examples_for_controller_creating.rb b/spec/support/shared_examples_for_controller_creating.rb index f994c484..bf099521 100644 --- a/spec/support/shared_examples_for_controller_creating.rb +++ b/spec/support/shared_examples_for_controller_creating.rb @@ -45,7 +45,7 @@ end it 'should be json' do - expect(response.content_type).to eql 'application/json' + expect(response.media_type).to eql 'application/json' end it 'should be an object' do diff --git a/spec/support/shared_examples_for_controller_updating.rb b/spec/support/shared_examples_for_controller_updating.rb index 8b5acc25..5397072f 100644 --- a/spec/support/shared_examples_for_controller_updating.rb +++ b/spec/support/shared_examples_for_controller_updating.rb @@ -48,7 +48,7 @@ end it 'should be json' do - expect(response.content_type).to eql 'application/json' + expect(response.media_type).to eql 'application/json' end it 'should be an object' do