Commit ea0db8bdfd21cf8b0da3498262511d48e1268ab8

Authored by Daniel Alves + Guilherme Rojas
Committed by Paulo Meireles
1 parent 8a887de7

[Mezuro] Solving conflicts on mezuro_steps.rb and project.feature.

features/step_definitions/mezuro_steps.rb
@@ -60,17 +60,26 @@ When /^I have a Mezuro (project|reading group) with the following data$/ do |typ @@ -60,17 +60,26 @@ When /^I have a Mezuro (project|reading group) with the following data$/ do |typ
60 result.save! 60 result.save!
61 end 61 end
62 62
63 -When /^I update this Mezuro (project|reading group) with the following data$/ do |type, fields|  
64 - find_field("article_name").set fields.rows_hash[:Title]  
65 - find_field("article_description").set fields.rows_hash[:Description] 63 +When /^I have a configuration with the following data$/ do |fields|
  64 + attributes = {}
  65 + fields.rows_hash.each do |name, value|
  66 + attributes.merge!(name => value)
  67 + end
  68 + Kalibro::Configuration.create(attributes)
66 end 69 end
67 70
68 When /^I erase the "([^"]*)" field$/ do |field_name| 71 When /^I erase the "([^"]*)" field$/ do |field_name|
69 find_field(field_name).set "" 72 find_field(field_name).set ""
70 end 73 end
71 74
72 -When /^I fill the fields with the following data$/ do |fields|  
73 - fields.rows_hash.each do |name, value|  
74 - find_field(name.to_s).set value 75 +When /^I fill the fields with the new following data$/ do |fields|
  76 + fields.rows_hash.each do |key, value|
  77 + name = key.to_s
  78 + element = find_field(name)
  79 + if element.tag_name.to_s == "select"
  80 + select(value, :from => name)
  81 + else
  82 + element.set value
  83 + end
75 end 84 end
76 end 85 end
plugins/mezuro/features/project.feature
@@ -68,9 +68,9 @@ Feature: Project @@ -68,9 +68,9 @@ Feature: Project
68 And I am on article "Sample Project" 68 And I am on article "Sample Project"
69 And I should be on /mycommunity/sample-project 69 And I should be on /mycommunity/sample-project
70 And I follow "Edit" 70 And I follow "Edit"
71 - When I update this Mezuro project with the following data  
72 - | Title | Another Project |  
73 - | Description | Another Description| 71 + When I fill the fields with the new following data
  72 + | article_name | Another Project |
  73 + | article_description | Another Description|
74 And I press "Save" 74 And I press "Save"
75 Then I should see "Another Project" 75 Then I should see "Another Project"
76 And I should see "Another Description" 76 And I should see "Another Description"
@@ -102,9 +102,9 @@ Feature: Project @@ -102,9 +102,9 @@ Feature: Project
102 And I am on article "Sample Project" 102 And I am on article "Sample Project"
103 And I should be on /mycommunity/sample-project 103 And I should be on /mycommunity/sample-project
104 And I follow "Edit" 104 And I follow "Edit"
105 - When I update this Mezuro project with the following data  
106 - | Title | Another Project |  
107 - | Description | Another Description| 105 + When I fill the fields with the new following data
  106 + | article_name | Another Project |
  107 + | article_description | Another Description|
108 And I press "Save" 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." 109 Then I should see "Slug The title (article name) is already being used by another article, please use another title."
110 110
@@ -129,9 +129,9 @@ Feature: Project @@ -129,9 +129,9 @@ Feature: Project
129 | community | mycommunity | 129 | community | mycommunity |
130 And the following users 130 And the following users
131 | login | name | 131 | login | name |
132 - | adminuser | Admin |  
133 - And I am logged in as "adminuser" 132 + | user | User |
134 When I am on article "Sample Project" 133 When I am on article "Sample Project"
  134 + And I am logged in as "user"
135 And I should be on /mycommunity/sample-project 135 And I should be on /mycommunity/sample-project
136 Then I should not see "Delete" 136 Then I should not see "Delete"
137 And I should not see "Edit" 137 And I should not see "Edit"