diff --git a/app/views/reading_groups/show.html.erb b/app/views/reading_groups/show.html.erb index d06ff9f..e9975b4 100644 --- a/app/views/reading_groups/show.html.erb +++ b/app/views/reading_groups/show.html.erb @@ -52,6 +52,6 @@

<% if reading_groups_owner? @reading_group.id %> - <%= link_to 'Destroy reading group', reading_group_path(@reading_group.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> + <%= link_to 'Destroy Reading Group', reading_group_path(@reading_group.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> <% end %>

diff --git a/features/reading_group/show.feature b/features/reading_group/show.feature index 72f03e7..e15fcb3 100644 --- a/features/reading_group/show.feature +++ b/features/reading_group/show.feature @@ -3,24 +3,45 @@ Feature: Show Reading Group As a regular user I should be able to see each of them -@kalibro_restart @wip -Scenario: Should not show the create reading link to user that doesn't own the reading group +@kalibro_restart +Scenario: Should not show the create, edit and destroy reading link to user that doesn't own the reading group Given I am a regular user And I have a sample reading group And I have a sample reading within the sample reading group - When I am at the Sample Reading Group page - Then I should not see New Reading - And I should not see Destroy reading group + When I visit the Sample Reading Group page + Then I should be in the Sample Reading Group page + And I should not see New Reading And I should not see Edit + And I should not see Destroy -@kalibro_restart @wip -Scenario: Should show the create reading link to user that do own the reading group +@kalibro_restart +Scenario: Should show the links for the user that owns the reading group Given I am a regular user + And I am signed in And I own a sample reading group And I have a sample reading within the sample reading group When I visit the Sample Reading Group page Then I should be in the Sample Reading Group page - And I should see "Destroy" + And I should see "New Reading" And I should see "Edit" - And I should see "Destroy reading group" - And I should see "New reading group" \ No newline at end of file + And I should see "Destroy" + And I should see "Destroy Reading Group" + +@kalibro_restart +Scenario: Should show the information of the sample reading + Given I have a sample reading group + And I have a sample reading within the sample reading group + When I visit the Sample Reading Group page + Then I should be in the Sample Reading Group page + And I should not see There are no readings yet! + And I should see "Label" + And I should see "Grade" + And I should see "Color" + And I should see the information of the sample reading + +@kalibro_restart +Scenario: Should show a message when there is no readings + Given I have a sample reading group + When I visit the Sample Reading Group page + Then I should be in the Sample Reading Group page + And I should see "There are no readings yet!" diff --git a/features/step_definitions/reading_group_steps.rb b/features/step_definitions/reading_group_steps.rb index 91940da..0daf284 100644 --- a/features/step_definitions/reading_group_steps.rb +++ b/features/step_definitions/reading_group_steps.rb @@ -13,13 +13,16 @@ Given(/^I visit the Sample Reading Group page$/) do visit reading_group_path(@reading_group.id) end -When(/^I am at the Sample Reading Group page$/) do - p @reading_group +Then(/^I should be in the Sample Reading Group page$/) do page.should have_content(@reading_group.name) page.should have_content(@reading_group.description) end -Then(/^I should be in the Sample Reading Group page$/) do - page.should have_content(@reading_group.name) - page.should have_content(@reading_group.description) +Then(/^I should see the information of the sample reading$/) do + page.should have_content(@reading.label) + page.should have_content(@reading.grade) + pager = page.body + color = @reading.color.downcase + var = (pager =~ /#{color}/) + var.should_not be_nil end \ No newline at end of file -- libgit2 0.21.2