mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 01:05:01 -04:00
Rubocop: RSpecRails/HaveHttpStatus
This commit is contained in:
@@ -472,17 +472,6 @@ RSpec/VerifiedDoubles:
|
||||
- 'spec/controllers/gardens_controller_spec.rb'
|
||||
- 'spec/views/devise/shared/_links_spec.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: ResponseMethods.
|
||||
# ResponseMethods: response, last_response
|
||||
RSpecRails/HaveHttpStatus:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/v1/plantings_controller_spec.rb'
|
||||
- 'spec/controllers/harvests_controller_spec.rb'
|
||||
- 'spec/controllers/likes_controller_spec.rb'
|
||||
- 'spec/requests/harvests_spec.rb'
|
||||
|
||||
# Offense count: 30
|
||||
# Configuration parameters: Database.
|
||||
# SupportedDatabases: mysql, postgresql
|
||||
|
||||
@@ -42,7 +42,7 @@ RSpec.describe Api::V1::PlantingsController do
|
||||
|
||||
it { expect(matching_planting).to include('id' => my_planting.id.to_s) }
|
||||
it { expect(matching_planting['attributes']).to eq expected_attributes }
|
||||
it { expect(response.status).to eq 200 }
|
||||
it { expect(response).to have_http_status :ok }
|
||||
end
|
||||
|
||||
context 'with photo' do
|
||||
@@ -81,7 +81,7 @@ RSpec.describe Api::V1::PlantingsController do
|
||||
|
||||
it { expect(matching_planting).to include('id' => my_planting.id.to_s) }
|
||||
it { expect(matching_planting['attributes']).to eq expected_attributes }
|
||||
it { expect(response.status).to eq 200 }
|
||||
it { expect(response).to have_http_status :ok }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,7 +51,7 @@ describe HarvestsController, :search do
|
||||
describe "generates a csv" do
|
||||
before { get :index, format: "csv" }
|
||||
|
||||
it { expect(response.status).to eq 200 }
|
||||
it { expect(response).to have_http_status :ok }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe LikesController do
|
||||
it { JSON.parse(response.body)["description"] == "1 like" }
|
||||
|
||||
describe "Liking someone else's post" do
|
||||
it { expect(response.code).to eq('201') }
|
||||
it { expect(response).to have_http_status(:created) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,14 +29,14 @@ describe LikesController do
|
||||
it { expect(response.content_type).to eq "application/json; charset=utf-8" }
|
||||
|
||||
describe "un-liking something i liked before" do
|
||||
it { expect(response.code).to eq('200') }
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
it { JSON.parse(response.body)["description"] == "0 likes" }
|
||||
end
|
||||
|
||||
describe "Deleting someone else's like" do
|
||||
let(:like) { create(:like) }
|
||||
|
||||
it { expect(response.code).to eq('403') }
|
||||
it { expect(response).to have_http_status(:forbidden) }
|
||||
it { JSON.parse(response.body)["error"] == "Unable to like" }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ describe "Harvests" do
|
||||
describe "GET /harvests" do
|
||||
it "works! (now write some real specs)" do
|
||||
get harvests_path
|
||||
expect(response.status).to be 200
|
||||
expect(response).to have_http_status :ok
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user