removes controller spec deprecation warnings

This commit is contained in:
rgarcia
2016-10-26 00:56:44 +02:00
committed by Julian Herrero
parent 0f34cae2ad
commit bca824b759
3 changed files with 12 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ describe HasFilters do
has_filters ["all", "pending", "reviewed"], only: :index has_filters ["all", "pending", "reviewed"], only: :index
def index def index
render text: "#{@current_filter} (#{@valid_filters.join(" ")})" render plain: "#{@current_filter} (#{@valid_filters.join(" ")})"
end end
end end
@@ -25,12 +25,12 @@ describe HasFilters do
end end
it "can be changed by the filter param" do it "can be changed by the filter param" do
get :index, filter: "pending" get :index, params: { filter: "pending" }
expect(response.body).to eq("pending (all pending reviewed)") expect(response.body).to eq("pending (all pending reviewed)")
end end
it "defaults to the first one on the list if given a bogus filter" do it "defaults to the first one on the list if given a bogus filter" do
get :index, filter: "foobar" get :index, params: { filter: "foobar" }
expect(response.body).to eq("all (all pending reviewed)") expect(response.body).to eq("all (all pending reviewed)")
end end
end end

View File

@@ -4,17 +4,17 @@ describe PagesController do
describe "Static pages" do describe "Static pages" do
it "includes a privacy page" do it "includes a privacy page" do
get :show, id: :privacy get :show, params: { id: :privacy }
expect(response).to be_ok expect(response).to be_ok
end end
it "includes a conditions page" do it "includes a conditions page" do
get :show, id: :conditions get :show, params: { id: :conditions }
expect(response).to be_ok expect(response).to be_ok
end end
it "includes a accessibility page" do it "includes a accessibility page" do
get :show, id: :accessibility get :show, params: { id: :accessibility }
expect(response).to be_ok expect(response).to be_ok
end end
end end
@@ -22,24 +22,24 @@ describe PagesController do
describe "More info pages" do describe "More info pages" do
it "includes a more info page" do it "includes a more info page" do
get :show, id: "help/index" get :show, params: { id: "help/index" }
expect(response).to be_ok expect(response).to be_ok
end end
it "includes a how_to_use page" do it "includes a how_to_use page" do
get :show, id: "help/how_to_use/index" get :show, params: { id: "help/how_to_use/index" }
expect(response).to be_ok expect(response).to be_ok
end end
it "includes a faq page" do it "includes a faq page" do
get :show, id: :faq get :show, params: { id: :faq }
expect(response).to be_ok expect(response).to be_ok
end end
end end
describe "Not found pages" do describe "Not found pages" do
it "returns a 404 message" do it "returns a 404 message" do
get :show, id: "nonExistentPage" get :show, params: { id: "nonExistentPage" }
expect(response).to be_missing expect(response).to be_missing
end end
end end

View File

@@ -10,7 +10,7 @@ describe Users::RegistrationsController do
context "when username is available" do context "when username is available" do
it "returns true with no error message" do it "returns true with no error message" do
get :check_username, username: "available username" get :check_username, params: { username: "available username" }
data = JSON.parse response.body, symbolize_names: true data = JSON.parse response.body, symbolize_names: true
expect(data[:available]).to be true expect(data[:available]).to be true
@@ -21,7 +21,7 @@ describe Users::RegistrationsController do
context "when username is not available" do context "when username is not available" do
it "returns false with an error message" do it "returns false with an error message" do
user = create(:user) user = create(:user)
get :check_username, username: user.username get :check_username, params: { username: user.username }
data = JSON.parse response.body, symbolize_names: true data = JSON.parse response.body, symbolize_names: true
expect(data[:available]).to be false expect(data[:available]).to be false