Move query-related step definitions to work_package_steps.rb

pull/643/head
Till Breuer 11 years ago committed by Till Breuer
parent c5b26e920a
commit d4d15fd30c
  1. 20
      features/step_definitions/general_steps.rb
  2. 20
      features/step_definitions/work_package_steps.rb

@ -344,26 +344,6 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following types:$/ do |project_na
end
end
Given(/^the user "([^\"]+)" has the following queries by type in the project "(.*?)":$/) do |login, project_name, table|
u = User.find_by_login login
p = get_project(project_name)
table.hashes.each_with_index do |t, i|
types = Type.find_all_by_name(t['type_value']).map {|type| type.id.to_s}
p.queries.create(user_id: u.id, name: t['name'], filters: {type_id: {operator: "=", values: types} })
end
end
Given(/^the user "([^\"]+)" has the following query menu items in the project "(.*?)":$/) do |login, project_name, table|
u = User.find_by_login login
p = get_project(project_name)
table.hashes.each_with_index do |t, i|
query = p.queries.find_by_name t['navigatable']
MenuItems::QueryMenuItem.create name: t['name'], title: t['title'], navigatable_id: query.id
end
end
When(/^I wait for "(.*?)" minutes$/) do |number_of_minutes|
page.set_rack_session(updated_at: Time.now - number_of_minutes.to_i.minutes)
end

@ -69,6 +69,26 @@ Given(/^the work_package "(.+?)" is updated with the following:$/) do |subject,
send_table_to_object(work_package, table, except)
end
Given(/^the user "([^\"]+)" has the following queries by type in the project "(.*?)":$/) do |login, project_name, table|
u = User.find_by_login login
p = get_project(project_name)
table.hashes.each_with_index do |t, i|
types = Type.find_all_by_name(t['type_value']).map {|type| type.id.to_s}
p.queries.create(user_id: u.id, name: t['name'], filters: {type_id: {operator: "=", values: types} })
end
end
Given(/^the user "([^\"]+)" has the following query menu items in the project "(.*?)":$/) do |login, project_name, table|
u = User.find_by_login login
p = get_project(project_name)
table.hashes.each_with_index do |t, i|
query = p.queries.find_by_name t['navigatable']
MenuItems::QueryMenuItem.create name: t['name'], title: t['title'], navigatable_id: query.id
end
end
When /^I fill in the id of work package "(.+?)" into "(.+?)"$/ do |wp_name, field_name|
work_package = InstanceFinder.find(WorkPackage, wp_name)

Loading…
Cancel
Save