Commit 59cfbf0d020fa3055b91528178b2732b97574075

Authored by Heitor
Committed by Rafael Manzo
1 parent 12d1384b

Fixed reading delete acceptance test

Signed off by: Diego Araújo <diegoamc90@gmail.com>
features/reading/delete.feature
@@ -10,7 +10,7 @@ Feature: Reading Deletion @@ -10,7 +10,7 @@ Feature: Reading Deletion
10 And I own a sample reading group 10 And I own a sample reading group
11 And I have a sample reading within the sample reading group 11 And I have a sample reading within the sample reading group
12 When I visit the Sample Reading Group page 12 When I visit the Sample Reading Group page
13 - And I click the Destroy link 13 + And I choose the destroy reading link
14 Then I should see "There are no Readings yet!" 14 Then I should see "There are no Readings yet!"
15 15
16 @kalibro_configuration_restart 16 @kalibro_configuration_restart
@@ -20,4 +20,4 @@ Feature: Reading Deletion @@ -20,4 +20,4 @@ Feature: Reading Deletion
20 And I have a sample reading group 20 And I have a sample reading group
21 And I have a sample reading within the sample reading group 21 And I have a sample reading within the sample reading group
22 When I visit the Sample Reading Group page 22 When I visit the Sample Reading Group page
23 - Then I should not see "Destroy"  
24 \ No newline at end of file 23 \ No newline at end of file
  24 + Then I should not see "Destroy"
features/step_definitions/reading_steps.rb
@@ -29,3 +29,8 @@ end @@ -29,3 +29,8 @@ end
29 Then(/^I should see a color picker Canvas$/) do 29 Then(/^I should see a color picker Canvas$/) do
30 page.find('div.colorpicker') 30 page.find('div.colorpicker')
31 end 31 end
  32 +
  33 +When(/^I choose the destroy reading link$/) do
  34 + url = "/reading_groups/#{@reading_group.id}/readings/#{@reading.id}"
  35 + find("//a[@href='#{url}']").click
  36 +end