mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 09:43:24 -04:00
Added feature tests for on gardens, seeds and harvests for the card based thumbnails
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
%h3.panel-title
|
||||
= link_to "#{garden.owner.login_name}'s garden", garden.owner
|
||||
- if can? :edit, garden
|
||||
%a.pull-right{:href => edit_garden_path(garden), :role => "button"}
|
||||
%a.pull-right{:href => edit_garden_path(garden), :role => "button", :id => "edit_garden_glyphicon"}
|
||||
%span.glyphicon.glyphicon-pencil{:title => "Edit"}
|
||||
.panel-body{:id => "gardens_panel_body"}
|
||||
.row
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
%h3.panel-title
|
||||
= link_to "#{harvest.owner.login_name}'s harvest", harvest.owner
|
||||
- if can? :edit, harvest
|
||||
%a.pull-right{:href => edit_harvest_path(harvest), :role => "button"}
|
||||
%a.pull-right{:href => edit_harvest_path(harvest), :role => "button", :id => "edit_harvest_glyphicon"}
|
||||
%span.glyphicon.glyphicon-pencil{:title => "Edit"}
|
||||
.panel-body
|
||||
.row
|
||||
|
||||
@@ -45,6 +45,18 @@ feature "Planting a crop", :js => true do
|
||||
expect(page).to have_content "Area must be greater than or equal to 0"
|
||||
end
|
||||
|
||||
context "Clicking edit from the index page" do
|
||||
|
||||
background do
|
||||
visit gardens_path
|
||||
end
|
||||
|
||||
scenario "button on index to edit garden" do
|
||||
first(".panel-title").click_link("edit_garden_glyphicon")
|
||||
page.should have_content 'Edit garden'
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Edit garden" do
|
||||
visit new_garden_path
|
||||
fill_in "Name", :with => "New garden"
|
||||
|
||||
@@ -26,10 +26,18 @@ feature "Harvesting a crop", :js => true do
|
||||
expect(page).to have_content "Harvest was successfully created"
|
||||
end
|
||||
|
||||
scenario "Clicking link to owner's profile" do
|
||||
visit harvests_by_owner_path(member)
|
||||
click_link "View #{member}'s profile >>"
|
||||
current_path.should eq member_path(member)
|
||||
context "Clicking edit from the index page" do
|
||||
let!(:harvest) { FactoryGirl.create(:harvest, :crop => maize, :owner => member) }
|
||||
|
||||
background do
|
||||
visit harvests_path
|
||||
end
|
||||
|
||||
scenario "button on index to edit harvest" do
|
||||
click_link "edit_harvest_glyphicon"
|
||||
current_path.should eq edit_harvest_path(harvest)
|
||||
page.should have_content 'Editing harvest'
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Harvesting from crop page" do
|
||||
@@ -63,4 +71,3 @@ feature "Harvesting a crop", :js => true do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user