mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 01:13:03 -04:00
Compare commits
1 Commits
rubocop-cl
...
RSpec/Incl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76cfd3957 |
@@ -334,26 +334,6 @@ RSpec/HooksBeforeExamples:
|
||||
Exclude:
|
||||
- 'spec/features/crops/creating_a_crop_spec.rb'
|
||||
|
||||
# Offense count: 53
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
RSpec/IncludeExamples:
|
||||
Exclude:
|
||||
- 'spec/features/conversations/index_spec.rb'
|
||||
- 'spec/features/crops/alternate_name_spec.rb'
|
||||
- 'spec/features/crops/browse_crops_spec.rb'
|
||||
- 'spec/features/crops/creating_a_crop_spec.rb'
|
||||
- 'spec/features/crops/crop_photos_spec.rb'
|
||||
- 'spec/features/crops/delete_crop_spec.rb'
|
||||
- 'spec/features/gardens/actions_spec.rb'
|
||||
- 'spec/features/gardens/adding_gardens_spec.rb'
|
||||
- 'spec/features/gardens/index_spec.rb'
|
||||
- 'spec/features/likeable_spec.rb'
|
||||
- 'spec/features/signout_spec.rb'
|
||||
- 'spec/models/crop_spec.rb'
|
||||
- 'spec/support/feature_helpers.rb'
|
||||
- 'spec/views/photos/show.html.haml_spec.rb'
|
||||
- 'spec/views/seeds/index.rss.haml_spec.rb'
|
||||
|
||||
# Offense count: 37
|
||||
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
||||
RSpec/IndexedLet:
|
||||
|
||||
@@ -18,7 +18,7 @@ describe "Conversations", :js do
|
||||
click_link 'Inbox'
|
||||
end
|
||||
|
||||
include_examples 'is accessible'
|
||||
it_behaves_like 'is accessible'
|
||||
|
||||
it { expect(page).to have_content 'something i want to say' }
|
||||
it { page.percy_snapshot(page, name: 'conversations#index') }
|
||||
|
||||
@@ -83,23 +83,23 @@ describe "Alternate names", :js do
|
||||
end
|
||||
|
||||
context 'Anonymous' do
|
||||
include_examples 'show alt names'
|
||||
it_behaves_like 'show alt names'
|
||||
end
|
||||
|
||||
context 'Signed in member' do
|
||||
include_context 'signed in member'
|
||||
include_examples 'show alt names'
|
||||
it_behaves_like 'show alt names'
|
||||
end
|
||||
|
||||
context 'Crop wrangler' do
|
||||
include_context 'signed in crop wrangler'
|
||||
include_examples 'show alt names'
|
||||
include_examples 'edit alt names'
|
||||
it_behaves_like 'show alt names'
|
||||
it_behaves_like 'edit alt names'
|
||||
end
|
||||
|
||||
context 'Admin' do
|
||||
include_context 'signed in admin'
|
||||
include_examples 'show alt names'
|
||||
include_examples 'edit alt names'
|
||||
it_behaves_like 'show alt names'
|
||||
it_behaves_like 'edit alt names'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,25 +34,25 @@ describe "browse crops", :search do
|
||||
end
|
||||
|
||||
context 'anon' do
|
||||
include_examples 'shows crops'
|
||||
it_behaves_like 'shows crops'
|
||||
it { expect(page).to have_no_link "Add New Crop" }
|
||||
end
|
||||
|
||||
context 'member' do
|
||||
include_context 'signed in member'
|
||||
include_examples 'shows crops'
|
||||
include_examples 'add new crop'
|
||||
it_behaves_like 'shows crops'
|
||||
it_behaves_like 'add new crop'
|
||||
end
|
||||
|
||||
context 'wrangler' do
|
||||
include_context 'signed in crop wrangler'
|
||||
include_examples 'shows crops'
|
||||
include_examples 'add new crop'
|
||||
it_behaves_like 'shows crops'
|
||||
it_behaves_like 'add new crop'
|
||||
end
|
||||
|
||||
context 'admin' do
|
||||
include_context 'signed in admin'
|
||||
include_examples 'shows crops'
|
||||
include_examples 'add new crop'
|
||||
it_behaves_like 'shows crops'
|
||||
it_behaves_like 'add new crop'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ describe "Crop", :js do
|
||||
|
||||
shared_examples 'request crop' do
|
||||
describe "requesting a crop with multiple scientific and alternate name" do
|
||||
include_examples 'fill in form'
|
||||
it_behaves_like 'fill in form'
|
||||
before do
|
||||
within "form#new_crop" do
|
||||
fill_in "request_notes", with: "This is the Philippine national flower."
|
||||
@@ -50,7 +50,7 @@ describe "Crop", :js do
|
||||
|
||||
shared_examples 'create crop' do
|
||||
describe "creating a crop with multiple scientific and alternate name" do
|
||||
include_examples 'fill in form'
|
||||
it_behaves_like 'fill in form'
|
||||
before do
|
||||
click_button "Save"
|
||||
end
|
||||
@@ -69,16 +69,16 @@ describe "Crop", :js do
|
||||
|
||||
context 'member' do
|
||||
include_context 'signed in member'
|
||||
include_examples 'request crop'
|
||||
it_behaves_like 'request crop'
|
||||
end
|
||||
|
||||
context 'crop wrangler' do
|
||||
include_context 'signed in crop wrangler'
|
||||
include_examples 'create crop'
|
||||
it_behaves_like 'create crop'
|
||||
end
|
||||
|
||||
context 'admin' do
|
||||
include_context 'signed in admin'
|
||||
include_examples 'create crop'
|
||||
it_behaves_like 'create crop'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -59,17 +59,17 @@ describe "crop detail page", :js, :search do
|
||||
|
||||
context "when signed in" do
|
||||
include_context 'signed in member'
|
||||
include_examples "shows photos"
|
||||
it_behaves_like "shows photos"
|
||||
end
|
||||
|
||||
context "when signed in as photos owner" do
|
||||
include_context 'signed in member'
|
||||
let(:member) { owner_member }
|
||||
|
||||
include_examples "shows photos"
|
||||
it_behaves_like "shows photos"
|
||||
end
|
||||
|
||||
context "when not signed in" do
|
||||
include_examples "shows photos"
|
||||
it_behaves_like "shows photos"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,11 +27,11 @@ describe "Delete crop spec" do
|
||||
|
||||
context "As a crop wrangler" do
|
||||
include_context 'signed in crop wrangler'
|
||||
include_examples 'delete crop'
|
||||
it_behaves_like 'delete crop'
|
||||
end
|
||||
|
||||
context 'admin' do
|
||||
include_context 'signed in admin'
|
||||
include_examples 'delete crop'
|
||||
it_behaves_like 'delete crop'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ describe "Gardens" do
|
||||
context 'my gardens' do
|
||||
before { visit gardens_path(member_slug: member.slug) }
|
||||
|
||||
include_examples "has buttons bar at top"
|
||||
it_behaves_like "has buttons bar at top"
|
||||
|
||||
context 'with actions menu expanded' do
|
||||
before { click_link 'Actions' }
|
||||
@@ -43,13 +43,13 @@ describe "Gardens" do
|
||||
context 'all gardens' do
|
||||
before { visit gardens_path }
|
||||
|
||||
include_examples "has buttons bar at top"
|
||||
it_behaves_like "has buttons bar at top"
|
||||
end
|
||||
|
||||
context "other member's garden" do
|
||||
before { visit gardens_path(member_slug: create(:member).slug) }
|
||||
|
||||
include_examples "has buttons bar at top"
|
||||
it_behaves_like "has buttons bar at top"
|
||||
describe 'does not show actions on other member garden' do
|
||||
it { is_expected.to have_no_link 'Actions' }
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ describe "Gardens", :js do
|
||||
include_context 'signed in member'
|
||||
before { visit new_garden_path }
|
||||
|
||||
include_examples 'is accessible'
|
||||
it_behaves_like 'is accessible'
|
||||
|
||||
it "displays required and optional fields properly" do
|
||||
expect(page).to have_css ".required", text: "Name"
|
||||
|
||||
@@ -14,7 +14,7 @@ describe "Gardens#index", :js do
|
||||
visit member_gardens_path(member_slug: member.slug)
|
||||
end
|
||||
|
||||
include_examples 'is accessible'
|
||||
it_behaves_like 'is accessible'
|
||||
|
||||
it "displays each of the gardens" do
|
||||
member.gardens.each do |garden|
|
||||
|
||||
@@ -58,13 +58,13 @@ describe 'Likeable', :js, :search do
|
||||
describe 'photos#index' do
|
||||
let(:path) { photos_path }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
|
||||
describe 'photos#show' do
|
||||
let(:path) { photo_path(photo) }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
|
||||
describe 'crops#show' do
|
||||
@@ -74,7 +74,7 @@ describe 'Likeable', :js, :search do
|
||||
|
||||
before { planting.photos << photo }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -82,27 +82,27 @@ describe 'Likeable', :js, :search do
|
||||
let(:like_count_class) { ".post-#{post.id} .like-count" }
|
||||
let(:path) { post_path(post) }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
|
||||
describe 'activities' do
|
||||
let(:like_count_class) { ".activity-#{activity.id} .like-count" }
|
||||
let(:path) { activity_path(activity) }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
|
||||
describe 'plantings' do
|
||||
let(:like_count_class) { ".planting-#{planting.id} .like-count" }
|
||||
let(:path) { planting_path(planting) }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
|
||||
describe 'harvests' do
|
||||
let(:like_count_class) { ".harvest-#{harvest.id} .like-count" }
|
||||
let(:path) { harvest_path(harvest) }
|
||||
|
||||
include_examples 'object can be liked'
|
||||
it_behaves_like 'object can be liked'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,11 +34,11 @@ describe "signout" do
|
||||
end
|
||||
|
||||
describe 'after signout, redirect to signin page if page needs authentication' do
|
||||
include_examples "sign-in redirects", "/plantings/new"
|
||||
include_examples "sign-in redirects", "/harvests/new"
|
||||
include_examples "sign-in redirects", "/posts/new"
|
||||
include_examples "sign-in redirects", "/gardens/new"
|
||||
include_examples "sign-in redirects", "/seeds/new"
|
||||
it_behaves_like "sign-in redirects", "/plantings/new"
|
||||
it_behaves_like "sign-in redirects", "/harvests/new"
|
||||
it_behaves_like "sign-in redirects", "/posts/new"
|
||||
it_behaves_like "sign-in redirects", "/gardens/new"
|
||||
it_behaves_like "sign-in redirects", "/seeds/new"
|
||||
end
|
||||
|
||||
it 'photos' do
|
||||
|
||||
@@ -154,7 +154,7 @@ describe Crop do
|
||||
|
||||
it { expect(crop.default_photo).to eq photo }
|
||||
|
||||
include_examples 'has default photo'
|
||||
it_behaves_like 'has default photo'
|
||||
end
|
||||
|
||||
context 'with a harvest photo' do
|
||||
@@ -165,7 +165,7 @@ describe Crop do
|
||||
|
||||
it { expect(crop.default_photo).to eq photo }
|
||||
|
||||
include_examples 'has default photo'
|
||||
it_behaves_like 'has default photo'
|
||||
|
||||
context 'and planting photo' do
|
||||
let(:planting) { create(:planting, crop:) }
|
||||
|
||||
@@ -14,17 +14,17 @@ module FeatureHelpers
|
||||
|
||||
shared_context 'signed in member' do
|
||||
let(:member) { create(:member) }
|
||||
include_examples 'sign in'
|
||||
it_behaves_like 'sign in'
|
||||
end
|
||||
|
||||
shared_context 'signed in crop wrangler' do
|
||||
let(:member) { create(:crop_wrangling_member) }
|
||||
include_examples 'sign in'
|
||||
it_behaves_like 'sign in'
|
||||
end
|
||||
|
||||
shared_context 'signed in admin' do
|
||||
let(:member) { create(:admin_member) }
|
||||
include_examples 'sign in'
|
||||
it_behaves_like 'sign in'
|
||||
end
|
||||
|
||||
shared_context 'sign in' do
|
||||
|
||||
@@ -58,7 +58,7 @@ describe "photos/show" do
|
||||
render
|
||||
end
|
||||
|
||||
include_examples "photo data renders"
|
||||
it_behaves_like "photo data renders"
|
||||
|
||||
it "has a delete button" do
|
||||
assert_select "a[href='#{photo_path(@photo)}']"
|
||||
@@ -71,8 +71,8 @@ describe "photos/show" do
|
||||
render
|
||||
end
|
||||
|
||||
include_examples "photo data renders"
|
||||
include_examples "No links to change data"
|
||||
it_behaves_like "photo data renders"
|
||||
it_behaves_like "No links to change data"
|
||||
end
|
||||
|
||||
context "not signed in" do
|
||||
@@ -81,8 +81,8 @@ describe "photos/show" do
|
||||
render
|
||||
end
|
||||
|
||||
include_examples "photo data renders"
|
||||
include_examples "No links to change data"
|
||||
it_behaves_like "photo data renders"
|
||||
it_behaves_like "No links to change data"
|
||||
end
|
||||
|
||||
context "CC-licensed photo" do
|
||||
|
||||
@@ -31,7 +31,7 @@ describe 'seeds/index.rss.haml', :search do
|
||||
render
|
||||
end
|
||||
|
||||
include_examples 'displays seed in rss feed'
|
||||
it_behaves_like 'displays seed in rss feed'
|
||||
|
||||
it 'shows RSS feed title' do
|
||||
expect(rendered).to have_content "Recent seeds from all members"
|
||||
@@ -60,6 +60,6 @@ describe 'seeds/index.rss.haml', :search do
|
||||
expect(rendered).to have_content "Recent seeds from #{seed.owner}"
|
||||
end
|
||||
|
||||
include_examples 'displays seed in rss feed'
|
||||
it_behaves_like 'displays seed in rss feed'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user