be_success -> be_successfull

fixes a deprecation warning
This commit is contained in:
Brenda Wallace
2019-06-27 22:23:47 +12:00
parent b0a8288330
commit 8faa712e07
10 changed files with 27 additions and 25 deletions

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.7.2

View File

@@ -197,7 +197,8 @@ class CropsController < ApplicationController
def crops
q = Crop.approved.includes(:scientific_names, plantings: :photos)
q = q.popular unless @sort == 'alpha'
q.order("LOWER(crops.name)").includes(:photos).paginate(page: params[:page])
q.order(Arel.sql("LOWER(crops.name)"))
.includes(:photos).paginate(page: params[:page])
end
def requested_crops

View File

@@ -7,7 +7,7 @@ describe AdminController do
before { get :newsletter }
describe 'fetches the admin newsletter page' do
it { expect(response).to be_success }
it { expect(response).to be_successful }
it { expect(response).to render_template("admin/newsletter") }
end

View File

@@ -7,19 +7,19 @@ describe Charts::CropsController do
describe 'sunniness' do
before { get :sunniness, params: { crop_slug: crop.to_param } }
it { expect(response).to be_success }
it { expect(response).to be_successful }
end
describe 'planted_from' do
before { get :planted_from, params: { crop_slug: crop.to_param } }
it { expect(response).to be_success }
it { expect(response).to be_successful }
end
describe 'harvested_for' do
before { get :harvested_for, params: { crop_slug: crop.to_param } }
it { expect(response).to be_success }
it { expect(response).to be_successful }
end
end
end

View File

@@ -22,7 +22,7 @@ describe CommentsController do
describe "returns an RSS feed" do
before { get :index, format: "rss" }
it { is_expected.to be_success }
it { is_expected.to be_successful }
it { is_expected.to render_template("comments/index") }
it { expect(response.content_type).to eq("application/rss+xml") }
it { expect(assigns(:comments)).to eq([last_comment, first_comment]) }
@@ -48,7 +48,7 @@ describe CommentsController do
it "dies if no post specified" do
get :new
expect(response).not_to be_success
expect(response).not_to be_successful
end
end
@@ -69,7 +69,7 @@ describe CommentsController do
describe "not my comment" do
let(:comment) { FactoryBot.create :comment, post: post }
it { expect(response).not_to be_success }
it { expect(response).not_to be_successful }
end
end
@@ -87,7 +87,7 @@ describe CommentsController do
describe "not my comment" do
let(:comment) { FactoryBot.create :comment }
it { expect(response).not_to be_success }
it { expect(response).not_to be_successful }
end
describe "attempting to change post_id" do
@@ -117,7 +117,7 @@ describe CommentsController do
describe "not my comment" do
let(:comment) { FactoryBot.create :comment }
it { expect(response).not_to be_success }
it { expect(response).not_to be_successful }
end
end
end

View File

@@ -12,14 +12,14 @@ describe CropsController do
context 'anonymous' do
before { get :wrangle }
it { is_expected.not_to be_success }
it { is_expected.not_to be_successful }
end
context 'wrangler' do
include_context 'login as wrangler'
before { get :wrangle }
it { is_expected.to be_success }
it { is_expected.to be_successful }
it { is_expected.to render_template("crops/wrangle") }
it { expect(assigns[:crop_wranglers]).to eq(Role.crop_wranglers) }
end
@@ -32,7 +32,7 @@ describe CropsController do
include_context 'login as wrangler'
before { get :hierarchy }
it { is_expected.to be_success }
it { is_expected.to be_successful }
it { is_expected.to render_template("crops/hierarchy") }
end
end
@@ -46,7 +46,7 @@ describe CropsController do
describe 'search form page' do
before { get :search }
it { is_expected.to be_success }
it { is_expected.to be_successful }
it { is_expected.to render_template("crops/search") }
end
@@ -62,7 +62,7 @@ describe CropsController do
describe "returns an RSS feed" do
before { get :index, format: "rss" }
it { is_expected.to be_success }
it { is_expected.to be_successful }
it { is_expected.to render_template("crops/index") }
it { expect(response.content_type).to eq("application/rss+xml") }
end

View File

@@ -18,14 +18,14 @@ describe MembersController do
describe "GET JSON index" do
it "provides JSON for members" do
get :index, format: 'json'
response.should be_success
response.should be_successful
end
end
describe "GET show" do
it "provides JSON for member profile" do
get :show, params: { slug: @member.to_param }, format: 'json'
response.should be_success
response.should be_successful
end
it "assigns @posts with the member's posts" do
@@ -59,7 +59,7 @@ describe MembersController do
describe "returns an RSS feed" do
before { get :show, params: { slug: @member.to_param }, format: "rss" }
it { response.should be_success }
it { response.should be_successful }
it { response.should render_template("members/show") }
it { response.content_type.should eq("application/rss+xml") }
end

View File

@@ -27,7 +27,7 @@ describe PostsController do
describe "GET RSS feed" do
it "returns an RSS feed" do
get :index, format: "rss"
expect(response).to be_success
expect(response).to be_successful
expect(response).to render_template("posts/index")
expect(response.content_type).to eq("application/rss+xml")
end
@@ -37,7 +37,7 @@ describe PostsController do
it "returns an RSS feed" do
post = Post.create! valid_attributes
get :show, format: "rss", params: { id: post.slug }
expect(response).to be_success
expect(response).to be_successful
expect(response).to render_template("posts/show")
expect(response.content_type).to eq("application/rss+xml")
end

View File

@@ -15,7 +15,7 @@ describe RobotsController do
it 'loads the staging robots.txt file' do
get :robots
expect(response).to be_success
expect(response).to be_successful
expect(response.body).to eq(File.read(staging_filename))
end
end
@@ -26,7 +26,7 @@ describe RobotsController do
it 'loads the production robots.txt file' do
get :robots
expect(response).to be_success
expect(response).to be_successful
expect(response.body).to eq(File.read(production_filename))
end
end
@@ -37,7 +37,7 @@ describe RobotsController do
it 'loads the production robots.txt file' do
get :robots
expect(response).to be_success
expect(response).to be_successful
expect(response.body).to eq(File.read(production_filename))
end
end
@@ -48,7 +48,7 @@ describe RobotsController do
it 'loads the production robots.txt file' do
get :robots
expect(response).to be_success
expect(response).to be_successful
expect(response.body).to eq(File.read(production_filename))
end
end

View File

@@ -16,7 +16,7 @@ describe SeedsController do
describe 'GET new' do
before { sign_in owner }
it { expect(response).to be_success }
it { expect(response).to be_successful }
context 'no parent planting' do
before { get :new }