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 60 result.save!
61 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 69 end
67 70  
68 71 When /^I erase the "([^"]*)" field$/ do |field_name|
69 72 find_field(field_name).set ""
70 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 84 end
76 85 end
... ...
plugins/mezuro/features/project.feature
... ... @@ -68,9 +68,9 @@ Feature: Project
68 68 And I am on article "Sample Project"
69 69 And I should be on /mycommunity/sample-project
70 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 74 And I press "Save"
75 75 Then I should see "Another Project"
76 76 And I should see "Another Description"
... ... @@ -102,9 +102,9 @@ Feature: Project
102 102 And I am on article "Sample Project"
103 103 And I should be on /mycommunity/sample-project
104 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 108 And I press "Save"
109 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 129 | community | mycommunity |
130 130 And the following users
131 131 | login | name |
132   - | adminuser | Admin |
133   - And I am logged in as "adminuser"
  132 + | user | User |
134 133 When I am on article "Sample Project"
  134 + And I am logged in as "user"
135 135 And I should be on /mycommunity/sample-project
136 136 Then I should not see "Delete"
137 137 And I should not see "Edit"
... ...