Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## features/order_management.feature
- Feature: Order management
- In order to maintain accurate order records
- As an administrator
- I want to be able to cancel and delete orders
- Scenario: Delete an order
- Given a current order for user "user1" containing spaces "A13"
- And a logged in admin user "admin" with password "secret"
- When I go to "This Year's Orders"
- And I follow "Delete"
- Then I should have 0 orders
- And space "A13" should not be reserved
- And I should see "This Year's Orders"
- ## features/steps/order_steps.rb
- Given /^a current order for user "([^\"]*)" containing spaces "([^\"]*)"$/ do |user, spaces|
- Given "a current Var entry"
- And "a multispace discount Product"
- And "existing non-reserved spaces \"#{spaces}\""
- @order = Factory(:order, :user => Factory(:user, :login => user))
- spaces.split(/, /).each do |space|
- @order.line_items << Factory(:line_item, :billable => Space.find_by_name(space), :price => 50.0, :quantity => 1)
- end
- end
- Then /^I should have ([0-9]+) orders$/ do |count|
- Order.count.should = count
- end
- ## features/steps/var_steps.rb
- Given /^a current Var entry$/ do
- Factory(:var)
- end
- ## features/steps/product_steps.rb
- Given /^a multispace discount Product$/ do
- Factory(:msd)
- end
- ## features/steps/space_steps.rb
- Given /^existing non-reserved spaces "([^\"]*)"$/ do |spaces|
- spaces.split(/, /).each do |space|
- myarray = space.scan(/([A-Z]{1,2})([0-9]{2})/)
- row = myarray[0][1]
- col = myarray[0][0]
- Factory(:space, :row => row, :col => col, :user => nil)
- end
- end
- When /^(?:|I )search for the space "([^\"]*)"$/ do |space|
- visit search_spaces_path(:search => "#{space}")
- end
- Then /^space "([^\"]*)" should not be reserved$/ do |space|
- space.user.should = nil
- end
- ## features/steps/authentication_steps.rb
- Given /^an existing normal user "([^\"]*)" with password "([^\"]*)"$/ do |user_name, password|
- Factory(:user, :login => user_name, :password => password, :password_confirmation => password, :admin => false)
- end
- Given /^an existing admin user "([^\"]*)" with password "([^\"]*)"$/ do |user_name, password|
- Factory(:user, :login => user_name, :password => password, :password_confirmation => password, :admin => true)
- end
- Given /^a logged in admin user "([^\"]*)" with password "([^\"]*)"$/ do |user_name, password|
- Given "an existing admin user \"#{user_name}\" with password \"#{password}\""
- And "I sign in as \"#{user_name}\" with password \"#{password}\""
- end
- Given /^(?:|I )sign in as "(.*)" with password "(.*)"$/ do |user_name, password|
- Given "I am on the login page"
- fill_in 'login', :with => user_name
- fill_in 'password', :with => password
- click_button 'Log in'
- end
Add Comment
Please, Sign In to add comment