Commit 75ce408f12d77cb79df10aab30d69e11b1785dc2
1 parent
336e34aa
Exists in
colab
and in
4 other branches
Finished MezuroConfiguration Acceptance tests
Showing
4 changed files
with
16 additions
and
13 deletions
Show diff stats
app/views/mezuro_configurations/show.html.erb
| ... | ... | @@ -11,4 +11,7 @@ |
| 11 | 11 | |
| 12 | 12 | <p> |
| 13 | 13 | <%= link_to 'Back', mezuro_configurations_path, class: 'btn btn-default' %> |
| 14 | + <% if configuration_owner? @configuration.id %> | |
| 15 | + <%= link_to 'Destroy configuration', mezuro_configuration_path(@configuration.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> | |
| 16 | + <% end %> | |
| 14 | 17 | </p> | ... | ... |
features/mezuro_configuration/deletion.feature
| ... | ... | @@ -17,7 +17,7 @@ Feature: Configuration Deletion |
| 17 | 17 | When I am at the Sample Configuration page |
| 18 | 18 | Then I should not see Destroy |
| 19 | 19 | |
| 20 | - @kalibro_restart @wip | |
| 20 | + @kalibro_restart | |
| 21 | 21 | Scenario: Should delete a configuration that I own |
| 22 | 22 | Given I am a regular user |
| 23 | 23 | And I am signed in | ... | ... |
features/mezuro_configuration/edition.feature
| ... | ... | @@ -3,7 +3,7 @@ Feature: Configuration |
| 3 | 3 | As a regular user |
| 4 | 4 | I should be able to edit my configurations |
| 5 | 5 | |
| 6 | - @kalibro_restarts @wip | |
| 6 | + @kalibro_restart | |
| 7 | 7 | Scenario: Should go to the edit page from a configuration that I own |
| 8 | 8 | Given I am a regular user |
| 9 | 9 | And I am signed in |
| ... | ... | @@ -20,7 +20,7 @@ Feature: Configuration |
| 20 | 20 | And I am at the All Configurations page |
| 21 | 21 | Then I should not see "Edit" within "table tr td" |
| 22 | 22 | |
| 23 | - @kalibro_restart @wip | |
| 23 | + @kalibro_restart | |
| 24 | 24 | Scenario: Should not render the edit page if the configuration doesn't belongs to the current user |
| 25 | 25 | Given I am a regular user |
| 26 | 26 | And I am signed in |
| ... | ... | @@ -29,7 +29,7 @@ Feature: Configuration |
| 29 | 29 | When I visit the sample configuration edit page |
| 30 | 30 | Then I should see "You're not allowed to do this operation" |
| 31 | 31 | |
| 32 | - @kalibro_restart @wip | |
| 32 | + @kalibro_restart | |
| 33 | 33 | Scenario: Filling up the form |
| 34 | 34 | Given I am a regular user |
| 35 | 35 | And I am signed in |
| ... | ... | @@ -39,7 +39,7 @@ Feature: Configuration |
| 39 | 39 | Then The field "mezuro_configuration[name]" should be filled with the sample configuration "name" |
| 40 | 40 | And The field "mezuro_configuration[description]" should be filled with the sample configuration "description" |
| 41 | 41 | |
| 42 | - @kalibro_restart @wip | |
| 42 | + @kalibro_restart | |
| 43 | 43 | Scenario: With valid attributes |
| 44 | 44 | Given I am a regular user |
| 45 | 45 | And I am signed in |
| ... | ... | @@ -51,7 +51,7 @@ Feature: Configuration |
| 51 | 51 | Then I should see "Kalibro" |
| 52 | 52 | And I should see "Web Service to collect metrics" |
| 53 | 53 | |
| 54 | - @kalibro_restart @wip | |
| 54 | + @kalibro_restart | |
| 55 | 55 | Scenario: With configuration name already taken |
| 56 | 56 | Given I am a regular user |
| 57 | 57 | And I am signed in |
| ... | ... | @@ -62,7 +62,7 @@ Feature: Configuration |
| 62 | 62 | When I press the Save button |
| 63 | 63 | Then I should see "There's already" |
| 64 | 64 | |
| 65 | - @kalibro_restart @wip | |
| 65 | + @kalibro_restart | |
| 66 | 66 | Scenario: Editing just the description |
| 67 | 67 | Given I am a regular user |
| 68 | 68 | And I am signed in |
| ... | ... | @@ -72,7 +72,7 @@ Feature: Configuration |
| 72 | 72 | When I press the Save button |
| 73 | 73 | And I should see "Web Service to collect metrics" |
| 74 | 74 | |
| 75 | - @kalibro_restart @wip | |
| 75 | + @kalibro_restart | |
| 76 | 76 | Scenario: With blank configuration name |
| 77 | 77 | Given I am a regular user |
| 78 | 78 | And I am signed in | ... | ... |
features/step_definitions/configuration_steps.rb
| ... | ... | @@ -15,8 +15,8 @@ Given(/^I have a sample configuration$/) do |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | Given(/^I own a sample configuration$/) do |
| 18 | - @mezuro_configuration = FactoryGirl.build(:mezuro_configuration, {id: nil}) | |
| 19 | - FactoryGirl.create(:mezuro_configuration_ownership, {user_id: @user.id, mezuro_configuration_id: @mezuro_configuration.id}) | |
| 18 | + @mezuro_configuration = FactoryGirl.create(:mezuro_configuration, {id: nil}) | |
| 19 | + FactoryGirl.create(:mezuro_configuration_ownership, {id: nil, user_id: @user.id, mezuro_configuration_id: @mezuro_configuration.id}) | |
| 20 | 20 | end |
| 21 | 21 | |
| 22 | 22 | Given(/^I am at the Sample Configuration page$/) do |
| ... | ... | @@ -28,12 +28,12 @@ Given(/^I am at the sample configuration edit page$/) do |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | Given(/^I own a configuration named "(.*?)"$/) do |name| |
| 31 | - @mezuro_configuration = FactoryGirl.build(:mezuro_configuration, {id: nil, name: name}) | |
| 32 | - FactoryGirl.create(:mezuro_configuration_ownership, {user_id: @user.id, mezuro_configuration_id: @mezuro_configuration.id}) | |
| 31 | + @mezuro_configuration = FactoryGirl.create(:mezuro_configuration, {id: nil, name: name}) | |
| 32 | + FactoryGirl.create(:mezuro_configuration_ownership, {id: nil, user_id: @user.id, mezuro_configuration_id: @mezuro_configuration.id}) | |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | When(/^I visit the sample configuration edit page$/) do |
| 36 | - visit edit_mezuro_configuration(@mezuro_configuration.id) | |
| 36 | + visit edit_mezuro_configuration_path(@mezuro_configuration.id) | |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | Then(/^I should be in the Edit Configuration page$/) do | ... | ... |