Commit 8032e50584a171b62e675095c3ae77de918c38e8

Authored by Diego Camarinha
Committed by Paulo Meireles
1 parent 4775b623

[Mezuro] Finishing acceptance tests for project feature.

features/step_definitions/mezuro_steps.rb
@@ -38,10 +38,14 @@ Then /^I should see "([^"]*)" button$/ do |button_name| @@ -38,10 +38,14 @@ Then /^I should see "([^"]*)" button$/ do |button_name|
38 find_button(button_name).should_not be_nil 38 find_button(button_name).should_not be_nil
39 end 39 end
40 40
  41 +Then /^I should not see "([^"]*)" button$/ do |button_name|
  42 + find_button(button_name).should be_nil
  43 +end
  44 +
41 When /^I have a Mezuro project with the following data$/ do |fields| 45 When /^I have a Mezuro project with the following data$/ do |fields|
42 item = {} 46 item = {}
43 fields.rows_hash.each do |name, value| 47 fields.rows_hash.each do |name, value|
44 - if(name=="community") 48 + if(name=="community" or name=="user")
45 item.merge!(:profile=>Profile[value]) 49 item.merge!(:profile=>Profile[value])
46 else 50 else
47 item.merge!(name => value) 51 item.merge!(name => value)
plugins/mezuro/features/project.feature
@@ -89,27 +89,50 @@ Feature: Project @@ -89,27 +89,50 @@ Feature: Project
89 And I press "Save" 89 And I press "Save"
90 Then I should see "Title can't be blank" 90 Then I should see "Title can't be blank"
91 91
92 -# @selenium  
93 -# Scenario: I delete a Mezuro project that belongs to me  
94 -# Given the following Mezuro project  
95 -# | name | description | owner |  
96 -# | Sample Project | Sample Description | joaosilva |  
97 -# And I am on article "Sample Project"  
98 -# And I should be on /joaosilva/sample-project  
99 -# When I follow "Delete"  
100 -# And I confirm the "Are you sure that you want to remove the item "Sample Project"?" dialog  
101 -# Then I go to /joaosilva/sample-project  
102 -# And I should see "There is no such page: /joaosilva/sample-project"  
103 -#  
104 -# @selenium  
105 -# Scenario: I cannot delete a Mezuro project that doesn't belong to me  
106 -# Given the following Mezuro project  
107 -# | name | description | owner |  
108 -# | Sample Project | Sample Description | joaosilva |  
109 -# And I am on article "Sample Project"  
110 -# And I should be on /joaosilva/sample-project  
111 -# When I follow "Delete"  
112 -# And I confirm the "Are you sure that you want to remove the item "Sample Project"?" dialog  
113 -# Then I go to /joaosilva/sample-project  
114 -# And I should see "There is no such page: /joaosilva/sample-project" 92 + @selenium
  93 + Scenario: I try to edit a Mezuro project with title of an existing Mezuro Project
  94 + Given I have a Mezuro project with the following data
  95 + | name | Sample Project |
  96 + | description | Sample Description |
  97 + | community | mycommunity |
  98 + And I have a Mezuro project with the following data
  99 + | name | Another Project |
  100 + | description | Another Description |
  101 + | community | mycommunity |
  102 + And I am on article "Sample Project"
  103 + And I should be on /mycommunity/sample-project
  104 + And I follow "Edit"
  105 + When I update this Mezuro project with the following data
  106 + | Title | Another Project |
  107 + | Description | Another Description|
  108 + And I press "Save"
  109 + Then I should see "Slug The title (article name) is already being used by another article, please use another title."
  110 +
  111 + @selenium
  112 + Scenario: I delete a Mezuro project that belongs to me
  113 + Given I have a Mezuro project with the following data
  114 + | name | Sample Project |
  115 + | description | Sample Description |
  116 + | community | mycommunity |
  117 + And I am on article "Sample Project"
  118 + And I should be on /mycommunity/sample-project
  119 + When I follow "Delete"
  120 + And I confirm the "Are you sure that you want to remove the item "Sample Project"?" dialog
  121 + Then I go to /mycommunity/sample-project
  122 + And I should see "There is no such page: /mycommunity/sample-project"
  123 +
  124 + @selenium
  125 + Scenario: I cannot edit or delete a Mezuro project that doesn't belong to me
  126 + Given I have a Mezuro project with the following data
  127 + | name | Sample Project |
  128 + | description | Sample Description |
  129 + | community | mycommunity |
  130 + Given the following users
  131 + | login | name |
  132 + | adminuser | Admin |
  133 + And I am logged in as "adminuser"
  134 + And I am on article "Sample Project"
  135 + And I should be on /mycommunity/sample-project
  136 + And I should not see "Delete"
  137 + And I should not see "Edit"
115 138