Skip to content

Commit

Permalink
Replace the deprecated be_success with be_successful
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 7, 2018
1 parent b9b0890 commit c743030
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions spec/controllers/bookmarks_controller_spec.rb
Expand Up @@ -11,7 +11,7 @@
describe "update" do
it "has a 200 status code when creating a new one" do
put :update, xhr: true, params: { id: '2007020969', format: :js }
expect(response).to be_success
expect(response).to be_successful
expect(response.code).to eq "200"
expect(JSON.parse(response.body)["bookmarks"]["count"]).to eq 1
end
Expand Down Expand Up @@ -39,7 +39,7 @@
format: :js
}

expect(response).to be_success
expect(response).to be_successful
expect(response.code).to eq "200"
expect(JSON.parse(response.body)["bookmarks"]["count"]).to eq 3
end
Expand All @@ -53,7 +53,7 @@

it "has a 200 status code when delete is success" do
delete :destroy, xhr: true, params: { id: '2007020969', format: :js }
expect(response).to be_success
expect(response).to be_successful
expect(response.code).to eq "200"
expect(JSON.parse(response.body)["bookmarks"]["count"]).to eq 0
end
Expand All @@ -69,7 +69,7 @@ class FooDocument < SolrDocument; end
],
format: :js
}
expect(response).to be_success
expect(response).to be_successful
expect(response.code).to eq "200"
expect(JSON.parse(response.body)["bookmarks"]["count"]).to eq 0
end
Expand Down
18 changes: 9 additions & 9 deletions spec/controllers/catalog_controller_spec.rb
Expand Up @@ -111,22 +111,22 @@
# NOTE: status code is always 200 in isolation mode ...
it "HTTP status code for GET should be 200", :integration => true do
get :index
expect(response).to be_success
expect(response).to be_successful
end
end

describe "with format :rss" do
it "gets the feed", :integration => true do
get :index, params: { format: 'rss' }
expect(response).to be_success
expect(response).to be_successful
end
end

describe "with format :json" do
render_views
before do
get :index, params: { format: 'json' }
expect(response).to be_success
expect(response).to be_successful
end
let(:json) { JSON.parse(response.body) }
let(:pages) { json['meta']['pages'] }
Expand Down Expand Up @@ -271,7 +271,7 @@
describe "with format :json" do
it "gets the feed" do
get :show, params: { id: doc_id, format: 'json' }
expect(response).to be_success
expect(response).to be_successful
json = JSON.parse response.body
expect(json["response"]["document"].keys).to include(
"author_tsim", "format", "title_tsim", "id", "subject_ssim",
Expand Down Expand Up @@ -327,7 +327,7 @@
# NOTE: status code is always 200 in isolation mode ...
it "HTTP status code for GET should be 200", :integration => true do
get :show, params: { id: doc_id }
expect(response).to be_success
expect(response).to be_successful
end

it "renders show.html.erb" do
Expand Down Expand Up @@ -370,7 +370,7 @@ def export_as_mock

it "responds to an extension-registered format properly" do
get :show, params: { id: doc_id, format: 'mock' }
expect(response).to be_success
expect(response).to be_successful
expect(response.body).to match /mock_export/
end

Expand All @@ -387,11 +387,11 @@ def export_as_mock
end
it "returns an opensearch description" do
get :opensearch, params: { format: 'xml' }
expect(response).to be_success
expect(response).to be_successful
end
it "returns valid JSON" do
get :opensearch, params: { format: 'json', q: 'a' }
expect(response).to be_success
expect(response).to be_successful
end
end

Expand Down Expand Up @@ -509,7 +509,7 @@ def export_as_mock
get :index, params: { q: '+' }
expect(response.redirect_url).to eq root_url
expect(request.flash[:notice]).to eq "Sorry, I don't understand your search."
expect(response).to_not be_success
expect(response).to_not be_successful
expect(response.status).to eq 302
end

Expand Down

0 comments on commit c743030

Please sign in to comment.