Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ RSpec/DescribeClass:
- 'spec/views/**/*.rb'
- 'spec/features/**/*.rb'

RSpec/NoExpectationExample:
Exclude:
- 'spec/features/percy/percy_spec.rb'

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Expand Down
3 changes: 0 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,6 @@ RSpec/NestedGroups:
# Offense count: 407
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Enabled: false

# Offense count: 4
RSpec/PendingWithoutReason:
Exclude:
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/likes_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

it { expect(Like.last.likeable_id).to eq(blogpost.id) }
it { expect(Like.last.likeable_type).to eq('Post') }
it { JSON.parse(response.body)["description"] == "1 like" }
it { expect(JSON.parse(response.body)["description"]).to eq "1 like" }

describe "Liking someone else's post" do
it { expect(response).to have_http_status(:created) }
Expand All @@ -30,14 +30,14 @@

describe "un-liking something i liked before" do
it { expect(response).to have_http_status(:ok) }
it { JSON.parse(response.body)["description"] == "0 likes" }
it { expect(JSON.parse(response.body)["description"]).to eq "0 likes" }
end

describe "Deleting someone else's like" do
let(:like) { create(:like) }

it { expect(response).to have_http_status(:forbidden) }
it { JSON.parse(response.body)["error"] == "Unable to like" }
it { expect(JSON.parse(response.body)["error"]).to eq "Unable to like" }
end
end
end
6 changes: 3 additions & 3 deletions spec/controllers/places_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@

it "assigns place name" do
get :show, params: { place: @member_london.location }
assigns(:place).should eq @member_london.location
expect(assigns(:place)).to eq @member_london.location
end

it "assigns nearby members" do
get :show, params: { place: @member_london.location }
assigns(:nearby_members).should eq [@member_london, @member_south_pole]
expect(assigns(:nearby_members)).to eq [@member_london, @member_south_pole]
end
end

describe "GET search" do
it "redirects to the new place" do
get :search, params: { new_place: "foo" }
response.should redirect_to place_path("foo")
expect(response).to redirect_to place_path("foo")
end
end
end
4 changes: 2 additions & 2 deletions spec/controllers/registrations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
describe "GET edit" do
it "assigns the requested member as @member" do
get :edit
assigns(:member).should eq(@member)
expect(assigns(:member)).to eq(@member)
end

it "picks up the flickr auth" do
@auth = create(:flickr_authentication, member: @member)
get :edit
assigns(:flickr_auth).should eq @auth
expect(assigns(:flickr_auth)).to eq @auth
end
end
end
2 changes: 1 addition & 1 deletion spec/controllers/scientific_names_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def valid_attributes
describe "GET new" do
it "assigns crop if specified" do
get :new, params: { crop_id: crop.id }
assigns(:crop).should be_an_instance_of Crop
expect(assigns(:crop)).to be_an_instance_of Crop
end
end
end
1 change: 1 addition & 0 deletions spec/features/admin/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
include_context 'signed in admin'
it "navigating to forum admin with js" do
visit admin_path
expect(page).to have_content 'Admin'
page.percy_snapshot(page, name: 'Admin page')
end
end
Expand Down
5 changes: 4 additions & 1 deletion spec/features/conversations/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
include_examples 'is accessible'

it { expect(page).to have_content 'something i want to say' }
it { page.percy_snapshot(page, name: 'conversations#index') }
it "takes a percy snapshot" do
expect(page).to have_content 'something i want to say'
page.percy_snapshot(page, name: 'conversations#index')
end

describe 'deleting' do
before do
Expand Down
6 changes: 5 additions & 1 deletion spec/features/conversations/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

it { expect(page).to have_content 'this is the body' }
it { expect(page).to have_link sender.login_name }
it { page.percy_snapshot(page, name: 'conversations#show') }

it "takes a percy snapshot" do
expect(page).to have_content 'this is the body'
page.percy_snapshot(page, name: 'conversations#show')
end

describe 'Replying to the conversation' do
before do
Expand Down
3 changes: 2 additions & 1 deletion spec/features/members/deletion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@
end

describe 'percy spec' do
it do
it "takes a percy snapshot" do
logout
login_as(member)
visit member_path(member)
click_link 'Edit profile'
click_link 'Delete Account'
expect(page).to have_content 'Delete Account'
page.percy_snapshot(page, name: 'Account deletion')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/rss/comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe 'Comments RSS feed' do
it 'The index feed exists' do
visit comments_path(format: 'rss')
# expect(page.status_code).to equal 200
expect(page).to have_http_status :ok
end

it 'The index title is what we expect' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/rss/crops_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it 'The index feed exists' do
Crop.reindex
visit crops_path(format: 'rss')
# expect(page.status_code).to equal 200
expect(page).to have_http_status :ok
end

it 'The index title is what we expect' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/rss/plantings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe 'Plantings RSS feed' do
it 'The index feed exists' do
visit plantings_path(format: 'rss')
# expect(page.status_code).to equal 200
expect(page).to have_http_status :ok
end

it 'The index title is what we expect' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/rss/posts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe 'Posts RSS feed' do
it 'The index feed exists' do
visit posts_path(format: 'rss')
# expect(page.status_code).to equal 200
expect(page).to have_http_status :ok
end

it 'The index title is what we expect' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/rss/seeds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe 'Seeds RSS feed' do
it 'The index feed exists' do
visit seeds_path(format: 'rss')
# expect(page.status_code).to equal 200
expect(page).to have_http_status :ok
end

it 'The index title is what we expect' do
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

describe ApplicationHelper do
it "parses dates" do
parse_date(nil).should be_nil
parse_date('').should be_nil
parse_date('2012-05-12').should eq Date.new(2012, 5, 12)
parse_date('may 12th 2012').should eq Date.new(2012, 5, 12)
expect(parse_date(nil)).to be_nil
expect(parse_date('')).to be_nil
expect(parse_date('2012-05-12')).to eq Date.new(2012, 5, 12)
expect(parse_date('may 12th 2012')).to eq Date.new(2012, 5, 12)
end

describe '#avatar_uri' do
Expand Down
14 changes: 7 additions & 7 deletions spec/helpers/harvests_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
quantity: nil,
weight_quantity: nil)
result = helper.display_quantity(harvest)
result.should eq 'not specified'
expect(result).to eq 'not specified'
end

it '3 individual' do
Expand All @@ -18,7 +18,7 @@
unit: 'individual',
weight_quantity: nil)
result = helper.display_quantity(harvest)
result.should eq '3'
expect(result).to eq '3'
end

it '1 bunch' do
Expand All @@ -27,7 +27,7 @@
unit: 'bunch',
weight_quantity: nil)
result = helper.display_quantity(harvest)
result.should eq '1 bunch'
expect(result).to eq '1 bunch'
end

it '3 bunches' do
Expand All @@ -36,7 +36,7 @@
unit: 'bunch',
weight_quantity: nil)
result = helper.display_quantity(harvest)
result.should eq '3 bunches'
expect(result).to eq '3 bunches'
end

it '3 kg' do
Expand All @@ -46,7 +46,7 @@
weight_quantity: 3,
weight_unit: 'kg')
result = helper.display_quantity(harvest)
result.should eq '3 kg'
expect(result).to eq '3 kg'
end

it '3 individual weighing 3 kg' do
Expand All @@ -56,7 +56,7 @@
weight_quantity: 3,
weight_unit: 'kg')
result = helper.display_quantity(harvest)
result.should eq '3, weighing 3 kg'
expect(result).to eq '3, weighing 3 kg'
end

it '3 bunches weighing 3 kg' do
Expand All @@ -66,7 +66,7 @@
weight_quantity: 3,
weight_unit: 'kg')
result = helper.display_quantity(harvest)
result.should eq '3 bunches, weighing 3 kg'
expect(result).to eq '3 bunches, weighing 3 kg'
end
end
end
2 changes: 1 addition & 1 deletion spec/lib/haml/filters/escaped_markdown_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

describe 'Haml::Filters::Escaped_Markdown' do
it 'is registered as the handler for :escaped_markdown' do
Haml::Filters.registered[:escaped_markdown].should ==
expect(Haml::Filters.registered[:escaped_markdown]).to eq
Haml::Filters::EscapedMarkdown
end

Expand Down
Loading
Loading