Whitespace fix, spec fix, and spec addition

This commit is contained in:
Logan Gingerich
2017-11-18 09:57:23 -07:00
committed by Shiny
parent b60510e016
commit 4ced7ee7e9
3 changed files with 6 additions and 2 deletions

View File

@@ -23,6 +23,6 @@
Delete
- if can?(:edit, @garden) && can?(:create, Photo)
= link_to new_photo_path(type: "garden", id: @garden.id),
class: 'btn btn-primary' do
class: 'btn btn-primary' do
%span.glyphicon.glyphicon-camera{ title: "Add Photo" }
Add Photo

View File

@@ -13,7 +13,7 @@ feature "new photo page" do
scenario "add photo" do
visit planting_path(planting)
click_link "Add photo"
click_link('Add photo', match: :first)
expect(page).to have_text planting.crop.name
end
end

View File

@@ -50,6 +50,10 @@ describe "gardens/show" do
rendered.should have_content "Plant something"
end
it "shows an 'add photo' button" do
rendered.should have_content "Add photo"
end
it "links to the right crop in the planting link" do
assert_select("a[href='#{new_planting_path}?garden_id=#{@garden.id}']")
end