diff --git a/features/step_definitions/mezuro_steps.rb b/features/step_definitions/mezuro_steps.rb index e25b007..7a3cdb6 100644 --- a/features/step_definitions/mezuro_steps.rb +++ b/features/step_definitions/mezuro_steps.rb @@ -60,17 +60,26 @@ When /^I have a Mezuro (project|reading group) with the following data$/ do |typ result.save! end -When /^I update this Mezuro (project|reading group) with the following data$/ do |type, fields| - find_field("article_name").set fields.rows_hash[:Title] - find_field("article_description").set fields.rows_hash[:Description] +When /^I have a configuration with the following data$/ do |fields| + attributes = {} + fields.rows_hash.each do |name, value| + attributes.merge!(name => value) + end + Kalibro::Configuration.create(attributes) end When /^I erase the "([^"]*)" field$/ do |field_name| find_field(field_name).set "" end -When /^I fill the fields with the following data$/ do |fields| - fields.rows_hash.each do |name, value| - find_field(name.to_s).set value +When /^I fill the fields with the new following data$/ do |fields| + fields.rows_hash.each do |key, value| + name = key.to_s + element = find_field(name) + if element.tag_name.to_s == "select" + select(value, :from => name) + else + element.set value + end end end diff --git a/plugins/mezuro/features/project.feature b/plugins/mezuro/features/project.feature index 63395b3..5391334 100644 --- a/plugins/mezuro/features/project.feature +++ b/plugins/mezuro/features/project.feature @@ -68,9 +68,9 @@ Feature: Project And I am on article "Sample Project" And I should be on /mycommunity/sample-project And I follow "Edit" - When I update this Mezuro project with the following data - | Title | Another Project | - | Description | Another Description| + When I fill the fields with the new following data + | article_name | Another Project | + | article_description | Another Description| And I press "Save" Then I should see "Another Project" And I should see "Another Description" @@ -102,9 +102,9 @@ Feature: Project And I am on article "Sample Project" And I should be on /mycommunity/sample-project And I follow "Edit" - When I update this Mezuro project with the following data - | Title | Another Project | - | Description | Another Description| + When I fill the fields with the new following data + | article_name | Another Project | + | article_description | Another Description| And I press "Save" Then I should see "Slug The title (article name) is already being used by another article, please use another title." @@ -129,9 +129,9 @@ Feature: Project | community | mycommunity | And the following users | login | name | - | adminuser | Admin | - And I am logged in as "adminuser" + | user | User | When I am on article "Sample Project" + And I am logged in as "user" And I should be on /mycommunity/sample-project Then I should not see "Delete" And I should not see "Edit" -- libgit2 0.21.2