From 6fa5c2ca2a38e7cd2e252e74e98b8753a702c0a5 Mon Sep 17 00:00:00 2001 From: Sean Schofield Date: Tue, 22 Nov 2011 21:34:43 -0500 Subject: [PATCH] Removed cucumber cruft --- Gemfile | 12 +- README.md | 14 +- Rakefile | 5 - api/Rakefile | 4 +- api/features/countries.feature | 16 -- api/features/inventory_units.feature | 19 -- api/features/line_items.feature | 19 -- api/features/orders.feature | 18 -- api/features/orders_description.feature | 15 -- api/features/products.feature | 29 -- api/features/shipment.feature | 18 -- api/features/states.feature | 16 -- api/features/step_definitions/api_steps.rb | 19 -- api/features/step_definitions/orders_steps.rb | 172 ------------ api/features/support/env.rb | 7 - api/features/support/factories.rb | 0 api/features/support/hooks.rb | 0 api/features/support/paths.rb | 39 --- api/features/users.feature | 19 -- auth/Rakefile | 4 +- auth/features/account.feature | 43 --- auth/features/admin_permissions.feature | 22 -- auth/features/checkout.feature | 218 --------------- auth/features/order.feature | 14 - auth/features/password_reset.feature | 19 -- auth/features/sign_in.feature | 39 --- auth/features/sign_out.feature | 11 - auth/features/sign_up.feature | 20 -- auth/features/support/env.rb | 7 - auth/features/support/paths.rb | 53 ---- auth/features/user.feature | 33 --- core/Rakefile | 4 +- .../configuration/analytics_tracker.feature | 28 -- .../configuration/general_settings.feature | 22 -- .../configuration/inventory_settings.feature | 15 -- .../admin/configuration/mail_methods.feature | 32 --- .../configuration/payment_methods.feature | 42 --- .../configuration/shipping_methods.feature | 21 -- .../admin/configuration/states.feature | 42 --- .../configuration/tax_categories.feature | 40 --- .../admin/configuration/taxonomies.feature | 42 --- .../admin/configuration/zones.feature | 25 -- core/features/admin/homepage.feature | 45 ---- .../features/admin/orders/adjustments.feature | 76 ------ .../admin/orders/customer_details.feature | 44 ---- core/features/admin/orders/history.feature | 10 - core/features/admin/orders/listing.feature | 55 ---- .../admin/orders/order_details.feature | 38 --- core/features/admin/orders/payments.feature | 84 ------ .../orders/return_authorizations.feature | 0 core/features/admin/orders/shipments.feature | 38 --- .../admin/products/edit/images.feature | 22 -- .../admin/products/edit/option_types.feature | 34 --- .../products/edit/product_details.feature | 16 -- .../products/edit/product_properties.feature | 57 ---- .../admin/products/edit/taxons.feature | 26 -- .../admin/products/edit/variants.feature | 67 ----- .../admin/products/option_types.feature | 37 --- .../admin/products/product_groups.feature | 244 ----------------- core/features/admin/products/products.feature | 127 --------- .../admin/products/properties.feature | 41 --- .../admin/products/prototypes.feature | 47 ---- core/features/admin/products/variant.feature | 18 -- core/features/admin/reports.feature | 20 -- core/features/admin/users.feature | 77 ------ core/features/checkout.feature | 19 -- core/features/products.feature | 74 ------ .../step_definitions/admin/configurations.rb | 58 ---- .../admin/configurations/mail_methods.rb | 11 - .../admin/configurations/payment_method.rb | 13 - .../admin/configurations/tax_categories.rb | 10 - .../admin/configurations/taxonomies.rb | 8 - .../step_definitions/admin/option_types.rb | 9 - .../features/step_definitions/admin/orders.rb | 68 ----- .../step_definitions/admin/product_groups.rb | 61 ----- .../step_definitions/admin/products.rb | 39 --- .../step_definitions/admin/products/images.rb | 4 - .../admin/products/product_properties.rb | 9 - .../step_definitions/admin/products/taxons.rb | 19 -- .../step_definitions/admin/properties.rb | 16 -- .../step_definitions/admin/prototypes.rb | 9 - .../step_definitions/admin/reports.rb | 23 -- core/features/step_definitions/admin/users.rb | 15 -- .../step_definitions/orders/adjustments.rb | 8 - .../step_definitions/orders/history.rb | 19 -- .../step_definitions/orders/order_details.rb | 67 ----- .../step_definitions/orders/payments.rb | 31 --- .../step_definitions/orders/shipments.rb | 9 - core/features/step_definitions/product.rb | 132 ---------- core/features/support/env.rb | 4 - core/features/support/paths.rb | 44 ---- .../generators/spree/dummy/dummy_generator.rb | 4 - .../dummy/templates/cucumber/cucumber.rb | 38 --- .../admin/products/edit/images_spec.rb | 2 +- .../requests/admin/products/products_spec.rb | 2 +- .../support}/ror_ringer.jpeg | Bin dash/Rakefile | 3 +- promo/Rakefile | 4 +- promo/features/promotion_adjustments.feature | 249 ------------------ .../step_definitions/promotions_steps.rb | 37 --- promo/features/support/env.rb | 4 - promo/features/support/paths.rb | 45 ---- 102 files changed, 11 insertions(+), 3616 deletions(-) delete mode 100644 api/features/countries.feature delete mode 100644 api/features/inventory_units.feature delete mode 100644 api/features/line_items.feature delete mode 100644 api/features/orders.feature delete mode 100644 api/features/orders_description.feature delete mode 100644 api/features/products.feature delete mode 100644 api/features/shipment.feature delete mode 100644 api/features/states.feature delete mode 100644 api/features/step_definitions/api_steps.rb delete mode 100644 api/features/step_definitions/orders_steps.rb delete mode 100644 api/features/support/env.rb delete mode 100644 api/features/support/factories.rb delete mode 100644 api/features/support/hooks.rb delete mode 100644 api/features/support/paths.rb delete mode 100644 api/features/users.feature delete mode 100644 auth/features/account.feature delete mode 100644 auth/features/admin_permissions.feature delete mode 100644 auth/features/checkout.feature delete mode 100644 auth/features/order.feature delete mode 100644 auth/features/password_reset.feature delete mode 100644 auth/features/sign_in.feature delete mode 100644 auth/features/sign_out.feature delete mode 100644 auth/features/sign_up.feature delete mode 100644 auth/features/support/env.rb delete mode 100644 auth/features/support/paths.rb delete mode 100644 auth/features/user.feature delete mode 100644 core/features/admin/configuration/analytics_tracker.feature delete mode 100644 core/features/admin/configuration/general_settings.feature delete mode 100644 core/features/admin/configuration/inventory_settings.feature delete mode 100644 core/features/admin/configuration/mail_methods.feature delete mode 100644 core/features/admin/configuration/payment_methods.feature delete mode 100644 core/features/admin/configuration/shipping_methods.feature delete mode 100644 core/features/admin/configuration/states.feature delete mode 100644 core/features/admin/configuration/tax_categories.feature delete mode 100644 core/features/admin/configuration/taxonomies.feature delete mode 100644 core/features/admin/configuration/zones.feature delete mode 100644 core/features/admin/homepage.feature delete mode 100644 core/features/admin/orders/adjustments.feature delete mode 100644 core/features/admin/orders/customer_details.feature delete mode 100644 core/features/admin/orders/history.feature delete mode 100644 core/features/admin/orders/listing.feature delete mode 100644 core/features/admin/orders/order_details.feature delete mode 100644 core/features/admin/orders/payments.feature delete mode 100644 core/features/admin/orders/return_authorizations.feature delete mode 100644 core/features/admin/orders/shipments.feature delete mode 100644 core/features/admin/products/edit/images.feature delete mode 100644 core/features/admin/products/edit/option_types.feature delete mode 100644 core/features/admin/products/edit/product_details.feature delete mode 100644 core/features/admin/products/edit/product_properties.feature delete mode 100644 core/features/admin/products/edit/taxons.feature delete mode 100644 core/features/admin/products/edit/variants.feature delete mode 100644 core/features/admin/products/option_types.feature delete mode 100644 core/features/admin/products/product_groups.feature delete mode 100644 core/features/admin/products/products.feature delete mode 100644 core/features/admin/products/properties.feature delete mode 100644 core/features/admin/products/prototypes.feature delete mode 100644 core/features/admin/products/variant.feature delete mode 100644 core/features/admin/reports.feature delete mode 100644 core/features/admin/users.feature delete mode 100644 core/features/checkout.feature delete mode 100644 core/features/products.feature delete mode 100644 core/features/step_definitions/admin/configurations.rb delete mode 100644 core/features/step_definitions/admin/configurations/mail_methods.rb delete mode 100644 core/features/step_definitions/admin/configurations/payment_method.rb delete mode 100644 core/features/step_definitions/admin/configurations/tax_categories.rb delete mode 100644 core/features/step_definitions/admin/configurations/taxonomies.rb delete mode 100644 core/features/step_definitions/admin/option_types.rb delete mode 100644 core/features/step_definitions/admin/orders.rb delete mode 100644 core/features/step_definitions/admin/product_groups.rb delete mode 100644 core/features/step_definitions/admin/products.rb delete mode 100644 core/features/step_definitions/admin/products/images.rb delete mode 100644 core/features/step_definitions/admin/products/product_properties.rb delete mode 100644 core/features/step_definitions/admin/products/taxons.rb delete mode 100644 core/features/step_definitions/admin/properties.rb delete mode 100644 core/features/step_definitions/admin/prototypes.rb delete mode 100644 core/features/step_definitions/admin/reports.rb delete mode 100644 core/features/step_definitions/admin/users.rb delete mode 100644 core/features/step_definitions/orders/adjustments.rb delete mode 100644 core/features/step_definitions/orders/history.rb delete mode 100644 core/features/step_definitions/orders/order_details.rb delete mode 100644 core/features/step_definitions/orders/payments.rb delete mode 100644 core/features/step_definitions/orders/shipments.rb delete mode 100644 core/features/step_definitions/product.rb delete mode 100644 core/features/support/env.rb delete mode 100644 core/features/support/paths.rb delete mode 100644 core/lib/generators/spree/dummy/templates/cucumber/cucumber.rb rename core/{features/step_definitions => spec/support}/ror_ringer.jpeg (100%) delete mode 100644 promo/features/promotion_adjustments.feature delete mode 100644 promo/features/step_definitions/promotions_steps.rb delete mode 100644 promo/features/support/env.rb delete mode 100644 promo/features/support/paths.rb diff --git a/Gemfile b/Gemfile index 37a304cc3a4..7fcdbaa0f82 100644 --- a/Gemfile +++ b/Gemfile @@ -18,16 +18,8 @@ group :test do gem 'rcov' gem 'faker' gem 'shoulda-matchers', '~> 1.0.0' -end - -group :cucumber do - gem 'cucumber-rails', '1.0.0' - gem 'database_cleaner', '= 0.6.7' - gem 'nokogiri' - gem 'capybara', '1.0.1' - gem 'factory_girl_rails', '~> 1.4.0' - gem 'faker' - gem 'launchy' + gem 'capybara' + gem 'database_cleaner' end group :ci do diff --git a/README.md b/README.md index 350d362e0d3..de317cae4f7 100644 --- a/README.md +++ b/README.md @@ -128,11 +128,9 @@ tests for the core project. $ cd core $ bundle exec rake test_app -Now you can run just the specs, just the features or everything together +You can run all of the tests with a single command - $ bundle exec rake spec - $ bundle exec rake cucumber - $ bundle exec rake #=> 'this will run both spec and cucumber tests for the gem' + $ bundle exec rake If you want to run specs for only a single spec file @@ -142,14 +140,6 @@ If you want to run a particular line of spec $ bundle exec rspec spec/models/state_spec.rb:7 -If you want to run a single cucumber feature - - $ bundle exec cucumber features/admin/orders.feature --require features - -If you want to run a particular scenario then include the line number - - $ bundle exec cucumber features/admin/orders.feature:3 --require features - Contributing ------------ diff --git a/Rakefile b/Rakefile index a3affad8345..1c6114d82db 100644 --- a/Rakefile +++ b/Rakefile @@ -15,11 +15,6 @@ def run_all_tests(database_name) sh "cd #{gem_name} && #{$0} test_app DB_NAME='#{database_name}'" sh "cd #{gem_name} && #{$0} spec" end - - #%w(api auth core promo).each do |gem_name| - #puts "########################### #{gem_name}|#{database_name} (features) ###########################" - #sh "cd #{gem_name} && bundle exec cucumber -p ci" - #end end desc "Generates a dummy app for testing for every Spree engine" diff --git a/api/Rakefile b/api/Rakefile index 24f3e66cd1b..ca1f8760cf8 100644 --- a/api/Rakefile +++ b/api/Rakefile @@ -3,13 +3,11 @@ require 'rake/testtask' require 'rake/packagetask' require 'rubygems/package_task' require 'rspec/core/rake_task' -require 'cucumber/rake/task' require 'spree/core/testing_support/common_rake' RSpec::Core::RakeTask.new -Cucumber::Rake::Task.new -task :default => [:spec, :cucumber ] +task :default => :spec spec = eval(File.read('spree_api.gemspec')) diff --git a/api/features/countries.feature b/api/features/countries.feature deleted file mode 100644 index ee3345d4191..00000000000 --- a/api/features/countries.feature +++ /dev/null @@ -1,16 +0,0 @@ -@api -Feature: Countries api - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of countries - When I send a GET request to "/api/countries" - Then the response status should be "200 OK" - And the response should be an array with 100 countries - - Scenario: Retrieve a country - When I send a GET request to "first country" - Then the response status should be "200 OK" - Then the response should have country information diff --git a/api/features/inventory_units.feature b/api/features/inventory_units.feature deleted file mode 100644 index fa4537120d6..00000000000 --- a/api/features/inventory_units.feature +++ /dev/null @@ -1,19 +0,0 @@ -@api -Feature: Inventory units api - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of inventory units - Given 2 inventory units exist - When I send a GET request to "/api/inventory_units" - Then the response status should be "200 OK" - And the response should be an array with 2 inventory units - - Scenario: Retrieve an inventory unit - Given 2 inventory units exist - When I send a GET request to "first inventory unit" - Then the response status should be "200 OK" - Then the response should have inventory unit information - diff --git a/api/features/line_items.feature b/api/features/line_items.feature deleted file mode 100644 index fe3b2057484..00000000000 --- a/api/features/line_items.feature +++ /dev/null @@ -1,19 +0,0 @@ -@api -Feature: Line items api - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of line items - Given 2 custom line items exist - When I send a GET request to "custom line items" - Then the response status should be "200 OK" - And the response should be an array with 2 line items - - Scenario: Retrieve a line item - Given 2 line items exist - When I send a GET request to "first line item" - Then the response status should be "200 OK" - Then the response should have line item information - diff --git a/api/features/orders.feature b/api/features/orders.feature deleted file mode 100644 index 00611960ab1..00000000000 --- a/api/features/orders.feature +++ /dev/null @@ -1,18 +0,0 @@ -@api -Feature: Orders api description - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of my orders - Given I have 5 orders - When I send a GET request to "/api/orders" - Then the response status should be "200 OK" - And the response should be an array with 5 orders - - Scenario: Retrieve an order - Given I have 2 orders - When I send a GET request to "first order" - Then the response status should be "200 OK" - Then the response should have order information diff --git a/api/features/orders_description.feature b/api/features/orders_description.feature deleted file mode 100644 index e827d153c45..00000000000 --- a/api/features/orders_description.feature +++ /dev/null @@ -1,15 +0,0 @@ -@api -Feature: Orders api description - In order to get details on order that have been placed - As a developer - I want to see order details placed from my storefront - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of my orders - Given I have 5 orders - When I send a GET request to "/api/orders" - Then the response status should be "200 OK" - And the response should be an array with 5 orders diff --git a/api/features/products.feature b/api/features/products.feature deleted file mode 100644 index 873f3ab57dd..00000000000 --- a/api/features/products.feature +++ /dev/null @@ -1,29 +0,0 @@ -@api -Feature: Products api description - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of products - Given 2 products exist - When I send a GET request to "/api/products" - Then the response status should be "200 OK" - And the response should be an array with 2 products - - Scenario: Retrieve a list of products after searching - Given the following product exist: - | name | - | apache baseball cap | - | zomg shirt | - When I send a GET request to "/api/products.json?search[name_like]=shirt" - Then the response status should be "200 OK" - And the response should be an array with 1 product - Then the response should have product information for shirt - - Scenario: Retrieve a product - Given 2 products exist - When I send a GET request to "first product" - Then the response status should be "200 OK" - Then the response should have product information - diff --git a/api/features/shipment.feature b/api/features/shipment.feature deleted file mode 100644 index 9c945ec93d3..00000000000 --- a/api/features/shipment.feature +++ /dev/null @@ -1,18 +0,0 @@ -@api -Feature: Shipments api description - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of shipments - Given 2 shipments exist - When I send a GET request to "/api/shipments" - Then the response status should be "200 OK" - And the response should be an array with 2 shipments - - Scenario: Retrieve a shipment - Given 2 shipments exist - When I send a GET request to "first shipment" - Then the response status should be "200 OK" - Then the response should have shipment information diff --git a/api/features/states.feature b/api/features/states.feature deleted file mode 100644 index 8c1c295f0d4..00000000000 --- a/api/features/states.feature +++ /dev/null @@ -1,16 +0,0 @@ -@api -Feature: States api - - Background: - Given I am a valid API user - And I send and accept json - - Scenario: Retrieve a list of states - When I send a GET request to "custom states list" - Then the response status should be "200 OK" - And the response should be an array with 51 states - - Scenario: Retrieve a state - When I send a GET request to "first state" - Then the response status should be "200 OK" - Then the response should have state information diff --git a/api/features/step_definitions/api_steps.rb b/api/features/step_definitions/api_steps.rb deleted file mode 100644 index e988242effd..00000000000 --- a/api/features/step_definitions/api_steps.rb +++ /dev/null @@ -1,19 +0,0 @@ -World(Rack::Test::Methods) - -Given /^I am a valid API user$/ do - @user = Factory(:user) - unless admin_role = Spree::Role.find_by_name('admin') - admin_role = Spree::Role.create(:name => 'admin') - end - - unless @user.roles(&:name).include?('admin') - @user.roles << admin_role - end - - authorize @user.authentication_token, "X" -end - -Given /^I send and accept json$/ do - header "Content-Type","application/json" - header "Accept","application/json" -end diff --git a/api/features/step_definitions/orders_steps.rb b/api/features/step_definitions/orders_steps.rb deleted file mode 100644 index 3d6fb7d227e..00000000000 --- a/api/features/step_definitions/orders_steps.rb +++ /dev/null @@ -1,172 +0,0 @@ -Given /^I have (\d+) orders$/ do |o| - user = Factory(:user) - Spree::Order.delete_all - (1..o.to_i).each{ |n| Spree::Order.create(:email => user.email,:number => 99 + n) } - @orders = Spree::Order.all -end - -Given /^2 custom line items exist$/ do - line_item1 = Factory(:line_item) - Factory(:line_item, :order => line_item1.order) -end - -When /^I send a GET request to "([^"]*)"$/ do |path| - url = if path == 'first country' - "/api/countries/#{Spree::Country.first.id}" - elsif path == 'first inventory unit' - "/api/inventory_units/#{Spree::InventoryUnit.first.id}" - elsif path == 'first shipment' - "/api/shipments/#{Spree::Shipment.first.id}" - elsif path == 'first order' - "/api/orders/#{Spree::Order.first.id}" - elsif path == 'first product' - "/api/products/#{Spree::Product.first.id}" - elsif path == 'custom line items' - line_item = Spree::LineItem.last - "/api/orders/#{line_item.order.id}/line_items" - elsif path == 'custom states list' - state = Spree::State.last - "/api/countries/#{state.country.id}/states" - elsif path == 'first state' - state = Spree::State.first - "/api/countries/#{state.country.id}/states/#{state.id}" - elsif path == 'first line item' - line_item = Spree::LineItem.first - "/api/orders/#{line_item.order.id}/line_items/#{line_item.id}" - else - path - end - get url -end - -Then /^the response status should be "([^"]*)"$/ do |status| - last_response.status.should == status.to_i -end - -Then /^the response should be an array with (\d+) states/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["state"] - - keys = ["abbr", "country_id", "id", "name"] - page.first['state'].keys.sort.should == keys -end - -Then /^the response should have state information$/ do - page = JSON.load(last_response.body) - page['state']['abbr'].should be_true - page['state']['name'].should be_true -end - -Then /^the response should be an array with (\d+) shipments/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["shipment"] - - keys = ["address", "cost", "created_at", "id", "inventory_units", "number", "order_id", "shipped_at", "shipping_method", "state", "tracking", "updated_at"] - page.first['shipment'].keys.sort.should == keys -end - -Then /^the response should have shipment information$/ do - page = JSON.load(last_response.body) - page['shipment']['address'].should be_true - page['shipment']['cost'].should be_true - page['shipment']['number'].should be_true - page['shipment']['shipping_method'].should be_true - page['shipment']['state'].should be_true - page['shipment']['tracking'].should be_true -end - - -Then /^the response should be an array with (\d+) products?/ do |num| - page = JSON.load(last_response.body) - - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["product"] - - keys = ["available_on", "count_on_hand", "created_at", "deleted_at", "description", "id", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at"] - page.first['product'].keys.sort.should == keys -end - -Then /^the response should have product information$/ do - page = JSON.load(last_response.body) - page['product']['permalink'].should be_true - page['product']['name'].should be_true - page['product']['count_on_hand'].should be_true -end - -Then /^the response should have product information for shirt$/ do - page = JSON.load(last_response.body).first - page['product']['permalink'].should be_true - page['product']['name'].should == 'zomg shirt' - page['product']['count_on_hand'].should be_true -end - -Then /^the response should be an array with (\d+) orders/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["order"] - - keys = ["adjustment_total", "bill_address_id", "completed_at", "created_at", "credit_total", "email", - "id", "item_total", "number", "payment_state", "payment_total", "ship_address_id", "shipment_state", - "shipping_method_id", "special_instructions", "state", "total", "updated_at", "user_id"] - - page.first['order'].keys.sort.should == keys -end - -Then /^the response should have order information$/ do - page = JSON.load(last_response.body) - page['order']['number'].should be_true - page['order']['state'].should be_true - page['order']['email'].should be_true - page['order']['credit_total'].should be_true -end - -Then /^the response should have country information$/ do - page = JSON.load(last_response.body) - page['country']['name'].should == 'Afghanistan' - page['country']['iso_name'].should == 'AFGHANISTAN' - page['country']['iso3'].should == 'AFG' - page['country']['iso'].should == 'AF' - page['country']['numcode'].should == 4 -end - -Then /^the response should be an array with (\d+) countries$/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["country"] - - keys = ["id", "iso", "iso3", "iso_name", "name", "numcode"] - page.first['country'].keys.sort.should == keys -end - -Then /^the response should be an array with (\d+) inventory units$/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["inventory_unit"] - - keys = ["created_at", "id", "lock_version", "order_id", "return_authorization_id", "shipment_id", "state", "updated_at", "variant_id"] - page.first['inventory_unit'].keys.sort.should == keys -end - -Then /^the response should have inventory unit information$/ do - page = JSON.load(last_response.body) - page['inventory_unit']['lock_version'].should be_true - page['inventory_unit']['state'].should be_true -end - -Then /^the response should be an array with (\d+) line items$/ do |num| - page = JSON.load(last_response.body) - page.map { |d| d['name'] }.length.should == num.to_i - page.first.keys.sort.should == ["line_item"] - - keys = ["created_at", "description", "id", "order_id", "price", "quantity", "updated_at", "variant", "variant_id"] - page.first['line_item'].keys.sort.should == keys -end - -Then /^the response should have line item information$/ do - page = JSON.load(last_response.body) - page['line_item']['description'].should match(/Size: S/) - page['line_item']['price'].should be_true - page['line_item']['quantity'].should be_true -end diff --git a/api/features/support/env.rb b/api/features/support/env.rb deleted file mode 100644 index 796cfd14178..00000000000 --- a/api/features/support/env.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'factory_girl' - -FEATURES_PATH = File.expand_path('../..', __FILE__) - -# load shared env with features -require File.expand_path('../../../../features/support/env', __FILE__) - diff --git a/api/features/support/factories.rb b/api/features/support/factories.rb deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/api/features/support/hooks.rb b/api/features/support/hooks.rb deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/api/features/support/paths.rb b/api/features/support/paths.rb deleted file mode 100644 index 962ec575309..00000000000 --- a/api/features/support/paths.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'spree/url_helpers' -module NavigationHelpers - include Spree::UrlHelpers - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # - def path_to(page_name) - case page_name - - when /the home\s?page/ - '/' - when /the login page/ - spree.login_path - when /the sign in page/ - spree.new_user_session_path - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(Spree::User.find_by_login($1)) - - else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - spree.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end - end - end -end - -World(NavigationHelpers) diff --git a/api/features/users.feature b/api/features/users.feature deleted file mode 100644 index 16e918de1af..00000000000 --- a/api/features/users.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: admin managing api key - - Scenario: admin clearing and regenerating api key - Given I have an admin account of "admin@person.com/password" - When I go to the admin page - And I should be on the login page - Then I sign in as "admin@person.com/password" - And I should see "Logged in successfully" - And I should be on the admin page - When I follow "Users" - When I click first link from selector "table#listing_users a.edit" - Then I should see "Editing User" - When I press "Clear API key" - Then I should see "No key defined" - When I press "Generate API key" - Then I should see "API key generated" - When I press "Clear API key" - Then I should see "API key cleared" - diff --git a/auth/Rakefile b/auth/Rakefile index 3cca0831888..649c8389872 100644 --- a/auth/Rakefile +++ b/auth/Rakefile @@ -4,13 +4,11 @@ require 'rake/testtask' require 'rake/packagetask' require 'rubygems/package_task' require 'rspec/core/rake_task' -require 'cucumber/rake/task' require 'spree/core/testing_support/common_rake' RSpec::Core::RakeTask.new -Cucumber::Rake::Task.new -task :default => [:spec, :cucumber] +task :default => :spec spec = eval(File.read('spree_auth.gemspec')) diff --git a/auth/features/account.feature b/auth/features/account.feature deleted file mode 100644 index c70b80faf69..00000000000 --- a/auth/features/account.feature +++ /dev/null @@ -1,43 +0,0 @@ -Feature: Account - In order to edit my account - As a user of different roles - I want to be able to navigate to my account page - - Scenario: Admin user account editing - Given I have an admin account of "admin@person.com/password" - And I go to the sign in page - When I sign in as "admin@person.com/password" - And I follow "My Account" - Then I should see "admin@person.com" - - Scenario: New user account editing - When I go to the sign up page - And I fill in "Email" with "email@person.com" - And I fill in "Password" with "password" - And I fill in "Password Confirmation" with "password" - And I press "Create" - When I follow "My Account" - Then I should see "email@person.com" - - Scenario: existing user account editing - Given the following user exists: - | email | password | password_confirmation | - | email@person.com | secret | secret | - And I go to the sign in page - When I sign in as "email@person.com/secret" - And I follow "My Account" - Then I should see "email@person.com" - - Scenario: existing user account editing - Given the following user exists: - | email | password | password_confirmation | - | email@person.com | secret | secret | - And I go to the sign in page - When I sign in as "email@person.com/secret" - And I follow "My Account" - And I follow "Edit" - And I fill in "Password" with "foobar" - And I fill in "Password Confirmation" with "foobar" - And I press "Update" - Then I should see "email@person.com" - And I should see "Account updated!" diff --git a/auth/features/admin_permissions.feature b/auth/features/admin_permissions.feature deleted file mode 100644 index 503c87798a4..00000000000 --- a/auth/features/admin_permissions.feature +++ /dev/null @@ -1,22 +0,0 @@ -@custom_permissions -Feature: Admin Permissions - - Background: Admin is restricted from accessing orders - Given I have an admin account of "admin@person.com/password" - Given I do not have permission to access orders - And I go to the sign in page - And I sign in as "admin@person.com/password" - - Scenario: Admin tries to list the orders - When I go to the admin orders page - Then I should see "Authorization Failure" - - Scenario: Admin tries to edit the order - Given an order exists with a number of "R123" - When I go to the edit admin order page for "R123" - Then I should see "Authorization Failure" - - Scenario: Admin tries to show the order - Given an order exists with a number of "R123" - When I go to the show admin order page for "R123" - Then I should see "Authorization Failure" diff --git a/auth/features/checkout.feature b/auth/features/checkout.feature deleted file mode 100644 index 15df8aa55d1..00000000000 --- a/auth/features/checkout.feature +++ /dev/null @@ -1,218 +0,0 @@ -Feature: Checkout - In order to buy stuff - As a user - I should be able to checkout - - @selenium @wip @stop - Scenario: Visitor make checkout as guest, without registration - Given a shipping method exists - Given a payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method and "Check" as payment method - Then I should see "Your order has been processed successfully" - - @selenium @wip @stop - Scenario: Uncompleted guest order should be associated with user after log in - Given a shipping method exists - Given a payment method exists - Given I am signed up as "email@person.com/password" - And I am logged out - - When I add a product with name: "RoR Mug" to cart - Then 2 users should exist - - When I go to the sign in page - And I sign in as "email@person.com/password" - Then I should be logged in - - When I follow "Cart" - Then I should see "RoR Mug" - And I should see "Shopping Cart" within "h1" - When I follow "Checkout" - - Then I should see "Billing Address" - And I should see "Shipping Address" - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method and "Check" as payment method - Then I should see "Your order has been processed successfully" - And I should have 1 order - - @selenium @stop - Scenario: User registers during checkout - Given a shipping method exists - Given a payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - When I follow "Create a new account" - - When I fill in "Email" with "email@person.com" - When I fill in "Password" with "spree123" - When I fill in "Password Confirmation" with "spree123" - And press "Create" - Then I should see "You have signed up successfully." - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method and "Check" as payment method - - Then I should see "Your order has been processed successfully" - And I should have 1 order - - @selenium - Scenario: The current payment method does not support profiles - Given a shipping method exists - Given a authorize net payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method - Then I should see "Payment Information" - - When I enter valid credit card details - Then I should not see "Confirm" - - @selenium @wip @stop - Scenario: When no shipping methods have been configured - Given a authorize net payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "No shipping methods available" - - @selenium - Scenario: When multiple payment methods have been configured - Given a shipping method exists - Given a payment method exists - Given a authorize net payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method - Then I should see "Payment Information" - - When I choose "Credit Card" - And I enter valid credit card details - Then I should not see "undefined method `authorize'" - - @selenium - Scenario: User submits an invalid credit card number - Given a shipping method exists - Given a bogus payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method - Then I should see "Payment Information" - - When I enter invalid credit card details - And press "Place Order" - Then I should see "Payment could not be processed" - - @selenium - Scenario: Completing checkout for a free order, skipping payment step - Given a free shipping method exists - Given a payment method exists - When I add a product with name: "RoR Mug", price: "0" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - And I should see "Shipping Address" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" - When I choose "UPS Ground" as shipping method - Then I should see "Your order has been processed successfully" - - @selenium - Scenario: Completing a checkout with invalid address input initially - Given a shipping method exists - Given a bogus payment method exists - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - When I follow "Checkout" - Then I should see "Registration" - - When I fill in "Email" with "spree@test.com" within "#guest_checkout" - And press "Continue" - Then I should see "Billing Address" - Then I should see "Shipping Address" - - When I fill in "First Name" with "Test" - And press "Save and Continue" - Then I should see "This field is required" - - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - Then I should see "Shipping Method" diff --git a/auth/features/order.feature b/auth/features/order.feature deleted file mode 100644 index 16043023e89..00000000000 --- a/auth/features/order.feature +++ /dev/null @@ -1,14 +0,0 @@ -Feature: View Order - In order to provide secure access to the user's order - A User - Should be able to view their cart at any time - - Scenario: User returns to their empty cart - When I go to the cart page - Then I should see "Your cart is empty" - - Scenario: User returns to their empty cart - Given I am on the cart page - When I go to the home page - And I return to the cart page - Then I should see "Your cart is empty" \ No newline at end of file diff --git a/auth/features/password_reset.feature b/auth/features/password_reset.feature deleted file mode 100644 index 0c18bcc8c79..00000000000 --- a/auth/features/password_reset.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: Password reset - In order to be able to login - A visitor - Should be able to reset their password - - Scenario: User indicates they have forgotten their password - When I go to the login page - And I follow "Forgot Password?" - Then I should see "your password will be emailed to you" - - Scenario: User supplies an email for the password reset - Given the following user exists: - | email | password | password_confirmation | - | foobar@example.com | secret | secret | - #Given a user exists with an email of "foobar@example.com" - When I go to the forgot password page - And I fill in "user_email" with "foobar@example.com" - And I press "Reset my password" - Then I should see "You will receive an email with instructions" diff --git a/auth/features/sign_in.feature b/auth/features/sign_in.feature deleted file mode 100644 index 4bd932c4cf4..00000000000 --- a/auth/features/sign_in.feature +++ /dev/null @@ -1,39 +0,0 @@ -Feature: Sign in - In order to make a purchase - A User - Should be able to sign in - - Background: - Given I am signed up as "email@person.com/secret" - And I go to the sign in page - - Scenario: User is asked to sign in - When I go to the admin page - Then I should not see "Authorization Failure" - - Scenario: User signs in successfully - Given I go to the home page - And I sign in as "email@person.com/secret" - Then I should see "Logged in successfully" - Then I should be on the products page - And I should be logged in - - Scenario: User is not signed up - Given I sign in as "email@person.com/wrong_password" - Then I should see "Invalid email or password" - And I should be logged out - - Scenario: User enters wrong password - Given I sign in as "email@person.com/wrongpassword" - Then I should be on the sign in page - And I should see "Invalid email or password" - And I should be logged out - - Scenario: User requests a restricted page with the correct password - Given I have an admin account of "admin@person.com/password" - When I go to the admin page - And I should be on the login page - Then I sign in as "admin@person.com/password" - And I should see "Logged in successfully" - And I should be on the admin page - diff --git a/auth/features/sign_out.feature b/auth/features/sign_out.feature deleted file mode 100644 index ea83d7f1546..00000000000 --- a/auth/features/sign_out.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: Sign out - In order to remove web session from the browser - A User - Should be able to sign out - - Scenario: User is signed in - Given I am signed up as "email@person.com/password" - When I go to the sign in page - And I sign in as "email@person.com/password" - And I follow "Logout" - Then I should be logged out \ No newline at end of file diff --git a/auth/features/sign_up.feature b/auth/features/sign_up.feature deleted file mode 100644 index 9f6b4290ad7..00000000000 --- a/auth/features/sign_up.feature +++ /dev/null @@ -1,20 +0,0 @@ -Feature: Sign up - In order to be able to make a purchase - A visitor - Should be able to sign up - - Scenario: User signs up with invalid data - When I go to the sign up page - And I fill in "Email" with "invalid email" - And I fill in "Password" with "password" - And I fill in "Password Confirmation" with "" - And I press "Create" - Then I should see error messages - - Scenario: User signs up with valid data - When I go to the sign up page - And I fill in "Email" with "email@person.com" - And I fill in "Password" with "password" - And I fill in "Password Confirmation" with "password" - And I press "Create" - Then I should see "You have signed up successfully." diff --git a/auth/features/support/env.rb b/auth/features/support/env.rb deleted file mode 100644 index 305bfbae77f..00000000000 --- a/auth/features/support/env.rb +++ /dev/null @@ -1,7 +0,0 @@ -FEATURES_PATH = File.expand_path('../..', __FILE__) - -# load shared env with features -require File.expand_path('../../../../features/support/env', __FILE__) - -Spree::Auth::Config.set(:registration_step => true) -Spree::Auth::Config.set(:signout_after_password_change => false) diff --git a/auth/features/support/paths.rb b/auth/features/support/paths.rb deleted file mode 100644 index 84c86601f26..00000000000 --- a/auth/features/support/paths.rb +++ /dev/null @@ -1,53 +0,0 @@ -require 'spree/url_helpers' -module NavigationHelpers - include Spree::UrlHelpers - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # - def path_to(page_name) - case page_name - - when /the home\s?page/ - '/' - when /the login page/ - spree.login_path - when /the sign in page/ - spree.new_user_session_path - when /the sign up page/ - spree.new_user_registration_path - when /the forgot password page/ - spree.new_user_password_path - when /the admin home page/ - spree.admin_path - when /my account page/ - spree.account_path - when /the admin orders page/ - spree.admin_orders_path - when /the edit admin order page for (.*)/ - spree.edit_admin_order_path($1) - when /the show admin order page for (.*)/ - spree.admin_order_path($1) - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) - - else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - spree.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end - end - end -end - -World(NavigationHelpers) diff --git a/auth/features/user.feature b/auth/features/user.feature deleted file mode 100644 index 84c8e96e3c8..00000000000 --- a/auth/features/user.feature +++ /dev/null @@ -1,33 +0,0 @@ -Feature: admin changing email address - - Background: - Given I have an admin account of "admin@person.com/password" - When I go to the admin page - And I should be on the login page - Then I sign in as "admin@person.com/password" - And I should see "Logged in successfully" - And I should be on the admin page - When I follow "Users" - When I click first link from selector "table#listing_users td.user_email a" - Then I should see "User Account" - Then I should see "admin@person.com" - Then I click first link from selector "a.edit_user" - Then I should see "Editing User" - - Scenario: admin editing email with validation error - When I fill in "user_email" with "a" - When I press "Update" - Then I should see "Email is invalid" - - Scenario: admin editing roles - When I check "user_role_user" - When I press "Update" - Then I should see "User has been successfully updated!" - When I click first link from selector "#content a.edit" - Then the "user_role_user" checkbox should be checked - - Scenario: listing users when anonymous users are present - Given an anonymous user has been created - When I follow "Users" - Then should not see "@example.net" - diff --git a/core/Rakefile b/core/Rakefile index 14ea79e9426..679ddc8a473 100644 --- a/core/Rakefile +++ b/core/Rakefile @@ -4,11 +4,9 @@ require 'rake/testtask' require 'rake/packagetask' require 'rubygems/package_task' require 'rspec/core/rake_task' -require 'cucumber/rake/task' require 'spree/core/testing_support/common_rake' RSpec::Core::RakeTask.new -Cucumber::Rake::Task.new spec = eval(File.read('spree_core.gemspec')) Gem::PackageTask.new(spec) do |p| @@ -21,7 +19,7 @@ task :release do cmd = "cd pkg && gem push spree_core-#{version}.gem"; puts cmd; system cmd end -task :default => [:spec, :cucumber] +task :default => :spec desc "Generates a dummy app for testing" task :test_app do diff --git a/core/features/admin/configuration/analytics_tracker.feature b/core/features/admin/configuration/analytics_tracker.feature deleted file mode 100644 index 2699de74541..00000000000 --- a/core/features/admin/configuration/analytics_tracker.feature +++ /dev/null @@ -1,28 +0,0 @@ -Feature: analytics tracker - - Scenario: index - Given 2 trackers exist - Given I go to the admin home page - When I follow "Configuration" - When I follow "Analytics Tracker" - Then I should see "Analytics Trackers" - Then verify data from "table.index" with following tabular values: - | Analytics ID | Environment | Active | Action | - | A100 | Cucumber | Yes | ignore | - | A100 | Cucumber | Yes | ignore | - - - Scenario: create - Given I go to the admin home page - When I follow "Configuration" - When I follow "Analytics Trackers" - When I should see "Analytics Trackers" - When I follow "admin_new_tracker_link" - When I fill in "tracker_analytics_id" with "A100" - When I select "Production" from "tracker-env" - When I press "Create" - Then I should see "successfully created!" - Then verify data from "table.index" with following tabular values: - | Analytics ID | Environment | Active | Action | - | A100 | Production | Yes | ignore | - diff --git a/core/features/admin/configuration/general_settings.feature b/core/features/admin/configuration/general_settings.feature deleted file mode 100644 index cd89e830fda..00000000000 --- a/core/features/admin/configuration/general_settings.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Admin > configurations > general_settings - - Scenario: visit general settings (admin) - Given I go to the admin home page - When I follow "Configuration" - When I follow "General Settings" - Then I should see "General Settings" - Then I should see "Site Name" - Then I should see "Site URL" - Then I should see "Spree Demo Site" - Then I should see "demo.spreecommerce.com" - - Scenario: edit general settings (admin) - Given preference settings exist - Given I go to the admin home page - When I follow "Configuration" - When I follow "General Settings" - When I follow "admin_general_settings_link" - Then I should see "Edit General Settings" - Then I fill in "app_configuration[preferred_site_name]" with "Spree Demo Site99" - Then I press "Update" - #Then I should see "Spree Demo Site99" #=> FIXME expected #has_content?("Spree Demo Site99") to return true, got false diff --git a/core/features/admin/configuration/inventory_settings.feature b/core/features/admin/configuration/inventory_settings.feature deleted file mode 100644 index ec64000e3eb..00000000000 --- a/core/features/admin/configuration/inventory_settings.feature +++ /dev/null @@ -1,15 +0,0 @@ -Feature: Admin > configurations > inventory_settings - - Scenario: Admin > configurations > inventory_settings - Given I go to the admin home page - When I follow "Configuration" - When I follow "Inventory Settings" - Then I should see "Inventory Settings" - Then I should see "Products with a zero inventory will be displayed" - Then I should see "Backordering allowed" - When I follow "admin_inventory_settings_link" - When I uncheck "preferences_show_zero_stock_products" - When I uncheck "preferences_allow_backorders" - #When I press "Update" #=> FIXME - - diff --git a/core/features/admin/configuration/mail_methods.feature b/core/features/admin/configuration/mail_methods.feature deleted file mode 100644 index 2c6d9036df6..00000000000 --- a/core/features/admin/configuration/mail_methods.feature +++ /dev/null @@ -1,32 +0,0 @@ -Feature: Admin > configurations > mail_methods - - Scenario: mail_methods index - Given a mail method exists - Given I go to the admin home page - When I follow "Configuration" - When I follow "Mail Methods" - #Then verify data from "table.index" with following tabular values: - #| Environment | Active | | - #| Cucumber | Yes | ignore | - Then I should see tabular data for mail methods index - - Scenario: create new mail_method - Given I go to the admin home page - When I follow "Configuration" - When I follow "Mail Methods" - When I follow "admin_new_mail_method_link" - Then I should see "New Mail Method" - When I press "Create" - Then I should see "successfully created!" - - Scenario: edit mail_method - Given a mail method exists - Given I go to the admin home page - When I follow "Configuration" - When I follow "Mail Methods" - When I click first link from selector "table#mail_methods_listing a.edit" - When I fill in "mail_method_preferred_mail_bcc" with "spree@example.com99" - When I press "Update" - Then I should see "successfully updated!" - When I click first link from selector "table#mail_methods_listing a.edit" - Then the "mail_method_preferred_mail_bcc" field should contain "spree@example.com99" diff --git a/core/features/admin/configuration/payment_methods.feature b/core/features/admin/configuration/payment_methods.feature deleted file mode 100644 index 2caa2c70baa..00000000000 --- a/core/features/admin/configuration/payment_methods.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Admin > configurations > payment_methods - - Scenario: admin visiting payment methods listing page - Given I go to the admin home page - When I follow "Configuration" - Given 2 payment methods exist - When I follow "Payment Methods" - Then I should see listing payment methods tabular attributes - - Scenario: admin creating new payment method - Given I go to the admin home page - When I follow "Configuration" - When I follow "Payment Methods" - When I follow "admin_new_payment_methods_link" - Then I should see "New Payment Method" - When I fill in "payment_method_name" with "check90" - When I fill in "payment_method_description" with "check90 desc" - When I select "PaymentMethod::Check" from "gtwy-type" - When I press "Create" - Then I should see "successfully created!" - - Scenario: admin editing payment method - Given 2 payment methods exist - Given I go to the admin home page - When I follow "Configuration" - When I follow "Payment Methods" - When I click first link from selector "table#listing_payment_methods a.edit" - When I fill in "payment_method_name" with "Payment 99" - When I press "Update" - Then I should see "successfully updated!" - Then the "payment_method_name" field should contain "Payment 99" - - Scenario: admin editing payment method with validation error - Given 2 payment methods exist - Given I go to the admin home page - When I follow "Configuration" - When I follow "Payment Methods" - When I click first link from selector "table#listing_payment_methods a.edit" - When I fill in "payment_method_name" with "" - When I press "Update" - #Then I should see "Name can't be blank" - #FIXME in cucumber environemnt even blank name is being saved. In development blank name shows error diff --git a/core/features/admin/configuration/shipping_methods.feature b/core/features/admin/configuration/shipping_methods.feature deleted file mode 100644 index 708afbca317..00000000000 --- a/core/features/admin/configuration/shipping_methods.feature +++ /dev/null @@ -1,21 +0,0 @@ -Feature: Admin > configurations > shipping_methods - - Scenario: Admin > configurations > shipping_methods - Given I go to the admin home page - When I follow "Configuration" - Given 2 shipping methods exist - When I follow "Shipping Methods" - Then I should see listing shipping methods tabular attributes - - Scenario: admin updating shipping methods - Given I go to the admin home page - When I follow "Configuration" - When I follow "Shipping Methods" - When I follow "admin_new_shipping_method_link" - Then I should see "New Shipping Method" - When I fill in "shipping_method_name" with "bullock cart" - When I press "Create" - Then I should see "successfully created!" - Then I should see "Editing Shipping Method" - When I press "Update" - Then I should see "successfully updated!" diff --git a/core/features/admin/configuration/states.feature b/core/features/admin/configuration/states.feature deleted file mode 100644 index dbd96d6e3f9..00000000000 --- a/core/features/admin/configuration/states.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Admin > configurations > states - - Scenario: admin visiting states listing - Given I go to the admin home page - When I follow "Configuration" - When I follow "States" - Then I should see listing states tabular attributes - - @javascript - Scenario: admin creating a new state and then editing it - Given I go to the admin home page - When I follow "Configuration" - When I follow "States" - When I select "Canada" from "country" - Then async - When I follow "new_state_link" - When I fill in "state_name" with "Calgary" - When I fill in "Abbreviation" with "CL" - When I press "Create" - Then I should see "successfully created!" - Then I should see "Calgary" - When I click first link from selector "table#listing_states td.actions a.edit" - Then I should see "Editing State" - Then the "state_name" field should contain "Calgary" - When I follow "States" - When I select "Canada" from "country" - Then async - Then I should see "Calgary" - - @javascript - Scenario: admin creating a new state with validation error - Given I go to the admin home page - When I follow "Configuration" - When I follow "States" - When I select "Canada" from "country" - Then async - When I follow "new_state_link" - When I fill in "state_name" with "" - When I fill in "Abbreviation" with "" - When I press "Create" - Then I should see "Name can't be blank" - diff --git a/core/features/admin/configuration/tax_categories.feature b/core/features/admin/configuration/tax_categories.feature deleted file mode 100644 index 1a783d91452..00000000000 --- a/core/features/admin/configuration/tax_categories.feature +++ /dev/null @@ -1,40 +0,0 @@ -Feature: Admin > configurations > tax_categories - - Scenario: admin visiting tax categories list - Given a tax category exists - Given I go to the admin home page - When I follow "Configuration" - When I follow "Tax Categories" - Then I should see "Listing Tax Categories" - Then I should see tabular data for tax categories index - - Scenario: admin creating new tax category - Given I go to the admin home page - When I follow "Configuration" - When I follow "Tax Categories" - When I follow "admin_new_tax_categories_link" - Then I should see "New Tax Category" - When I fill in "tax_category_name" with "sports goods" - When I fill in "tax_category_description" with "sports goods desc" - When I press "Create" - Then I should see "successfully created!" - - Scenario: admin creating new tax category with validation error - Given I go to the admin home page - When I follow "Configuration" - When I follow "Tax Categories" - When I follow "admin_new_tax_categories_link" - Then I should see "New Tax Category" - When I press "Create" - Then I should see "Name can't be blank" - - Scenario: admin editing a tax category - Given a tax category exists - Given I go to the admin home page - When I follow "Configuration" - When I follow "Tax Categories" - When I click first link from selector "table#listing_tax_categories a.edit" - When I fill in "tax_category_description" with "desc 99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "desc 99" diff --git a/core/features/admin/configuration/taxonomies.feature b/core/features/admin/configuration/taxonomies.feature deleted file mode 100644 index 4cf9da6ff82..00000000000 --- a/core/features/admin/configuration/taxonomies.feature +++ /dev/null @@ -1,42 +0,0 @@ -Feature: Admin > configurations > taxonomies - - Scenario: admin visiting taxonomies list - Given I go to the admin home page - When I follow "Configuration" - Given 2 taxonomies exist - When I follow "Taxonomies" - Then I should see tabular data for taxonomies list - - Scenario: admin creating new taxonomy - Given I go to the admin home page - When I follow "Configuration" - When I follow "Taxonomies" - When I follow "admin_new_taxonomy_link" - Then I should see "New Taxonomy" - When I fill in "taxonomy_name" with "sports" - When I press "Create" - Then I should see "successfully created!" - - Scenario: admin creating new taxonomy with validation error - Given I go to the admin home page - When I follow "Configuration" - When I follow "Taxonomies" - When I follow "admin_new_taxonomy_link" - Then I should see "New Taxonomy" - When I fill in "taxonomy_name" with "" - When I press "Create" - #FIXME the message below should actually be Name can't be blank - Then I should see "can't be blank" - - Scenario: admin editing taxonomy - Given 2 taxonomies exist - Given I go to the admin home page - When I follow "Configuration" - When I follow "Taxonomies" - When I click first link from selector "table#listing_taxonomies a.edit" - Then I should see "Edit taxonomy" - When I fill in "taxonomy_name" with "sports 99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "sports 99" - diff --git a/core/features/admin/configuration/zones.feature b/core/features/admin/configuration/zones.feature deleted file mode 100644 index da39304bdff..00000000000 --- a/core/features/admin/configuration/zones.feature +++ /dev/null @@ -1,25 +0,0 @@ -Feature: Admin > configurations > zones - - Scenario: admin visiting zones listing - Given I go to the admin home page - When I follow "Configuration" - Given all zones are deleted - Given the following zones exist: - | name | description | - | eastern | zone is eastern | - | western | cool san franciso | - When I follow "Zones" - Then I should see listing zones tabular attributes with name asc - When I follow "zones_order_by_description_title" - Then I should see listing zones tabular attributes with description asc - - Scenario: admin creating new zone - Given I go to the admin home page - When I follow "Configuration" - When I follow "Zones" - When I follow "admin_new_zone_link" - Then I should see "New Zone" - When I fill in "zone_name" with "asian" - When I fill in "zone_description" with "asian zone" - When I press "Create" - Then I should see "successfully created!" diff --git a/core/features/admin/homepage.feature b/core/features/admin/homepage.feature deleted file mode 100644 index 1636a3ab22e..00000000000 --- a/core/features/admin/homepage.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: Admin home page - In order to do administrative work - I should be able to login as an admin - - Scenario: Visiting admin home page - And I go to the admin home page - Then I should see "Administration" - Then page should have following links: - | url | text | within | - | /admin | Overview | #admin-menu | - | /admin/orders | Orders | #admin-menu | - | /admin/products | Products | #admin-menu | - | /admin/reports | Reports | #admin-menu | - | /admin/configurations | Configuration | #admin-menu | - | /admin/users | Users | #admin-menu | - Then I should see "Listing Orders" - When I follow "Products" - Then page should have following links: - | url | text | within | - | /admin/products | Products | #sub-menu | - | /admin/option_types | Option Types | #sub-menu | - | /admin/properties | Properties | #sub-menu | - | /admin/prototypes | Prototypes | #sub-menu | - | /admin/product_groups | Product Groups | #sub-menu | - When I follow "Reports" - Then I should see "Listing Reports" - When I follow "Configuration" - Then I should see "Configurations" - Then page should have following links: - | url | text | within | - | /admin/general_settings | General Settings | #content | - | /admin/mail_methods | Mail Methods | #content | - | /admin/tax_categories | Tax Categories | #content | - | /admin/zones | Zones | #content | - | /admin/countries/214/states | States | #content | - | /admin/payment_methods | Payment Methods | #content | - | /admin/taxonomies | Taxonomies | #content | - | /admin/shipping_methods | Shipping Methods | #content | - | /admin/shipping_categories | Shipping Categories | #content | - | /admin/inventory_settings | Inventory Settings | #content | - | /admin/tax_rates | Tax Rates | #content | - | /admin/tax_settings | Tax Settings | #content | - | /admin/trackers | Analytics Trackers | #content | - When I follow "Users" - Then I should see "Listing Users" diff --git a/core/features/admin/orders/adjustments.feature b/core/features/admin/orders/adjustments.feature deleted file mode 100644 index 09f5f2e9f7b..00000000000 --- a/core/features/admin/orders/adjustments.feature +++ /dev/null @@ -1,76 +0,0 @@ -Feature: Admin managing adjustments - - Scenario: adjustments list - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given an adjustment exists for order R100 - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Adjustments" - Then I should see row 0 and column 0 to have value "Date/Time" with selector "table.index" - Then I should see row 0 and column 1 to have value "Description" with selector "table.index" - Then I should see row 0 and column 2 to have value "Amount" with selector "table.index" - Then I should see row 1 and column 1 to have value "Shipping" with selector "table.index" - Then I should see row 1 and column 2 to have value "$100.00" with selector "table.index" - - - Scenario: admin creating new adjustment with validation error - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given an adjustment exists for order R100 - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Adjustments" - When I follow "New Adjustment" - When I fill in "adjustment_amount" with "" - When I fill in "adjustment_label" with "" - When I press "Continue" - Then I should see "Label can't be blank" - Then I should see "Amount is not a number" - - Scenario: admin creating new adjustment - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given an adjustment exists for order R100 - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Adjustments" - When I follow "New Adjustment" - When I fill in "adjustment_amount" with "10" - When I fill in "adjustment_label" with "rebate" - When I press "Continue" - Then I should see "successfully created!" - - Scenario: admin editing an adjustment - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given an adjustment exists for order R100 - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Adjustments" - When I click first link from selector "table.index td.actions a.edit" - When I fill in "adjustment_amount" with "99" - When I fill in "adjustment_label" with "rebate 99" - When I press "Continue" - Then I should see "successfully updated!" - Then I should see "rebate 99" - Then I should see "$99.00" - - Scenario: admin editing anadjustment with validation error - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given an adjustment exists for order R100 - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Adjustments" - When I click first link from selector "table.index td.actions a.edit" - When I fill in "adjustment_amount" with "" - When I fill in "adjustment_label" with "" - When I press "Continue" - Then I should see "Label can't be blank" - Then I should see "Amount is not a number" diff --git a/core/features/admin/orders/customer_details.feature b/core/features/admin/orders/customer_details.feature deleted file mode 100644 index 3de5c6071e3..00000000000 --- a/core/features/admin/orders/customer_details.feature +++ /dev/null @@ -1,44 +0,0 @@ -Feature: Admin managing customer details - - @javascript - Scenario: edit order - Given a shipping method exists with a display on of "front_end" - Given all orders are deleted - Given all line items are deleted - Given the following orders exist: - |completed at | - |2011-02-01 12:36:15 | - |2010-02-01 17:36:42 | - Given custom line items associated with products - When I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Customer Details" - When I fill in "order_ship_address_attributes_firstname" with "John 99" - When I fill in "order_ship_address_attributes_lastname" with "Doe" - When I fill in "order_ship_address_attributes_address1" with "100 first lane" - When I fill in "order_ship_address_attributes_address2" with "#101" - When I fill in "order_ship_address_attributes_city" with "Bethesda" - When I fill in "order_ship_address_attributes_zipcode" with "20170" - When I select "Maryland" from "order_ship_address_attributes_state_id" - When I fill in "order_ship_address_attributes_phone" with "123-456-7890" - When I press "Continue" - When I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Customer Details" - Then the "order_ship_address_attributes_firstname" field should contain "John 99" - - @javascript - Scenario: edit order with validation error - Given a shipping method exists with a display on of "front_end" - Given all orders are deleted - Given all line items are deleted - Given the following orders exist: - |completed at | - |2011-02-01 12:36:15 | - |2010-02-01 17:36:42 | - Given custom line items associated with products - When I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Customer Details" - When I press "Continue" - Then I should see "Shipping address first name can't be blank" diff --git a/core/features/admin/orders/history.feature b/core/features/admin/orders/history.feature deleted file mode 100644 index 30252685125..00000000000 --- a/core/features/admin/orders/history.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Admin visiting history - - @javascript - Scenario: edit order - Given an order exists - Given the order is finalized - When I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "History" - Then I should see order history tabular attributes diff --git a/core/features/admin/orders/listing.feature b/core/features/admin/orders/listing.feature deleted file mode 100644 index df96d842a96..00000000000 --- a/core/features/admin/orders/listing.feature +++ /dev/null @@ -1,55 +0,0 @@ -Feature: Admin visiting orders listing - - Scenario: orders listing - Given the following orders exist: - |created at | completed at | number | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 | - And I go to the admin home page - Then I should see row 1 and column 2 to have value "cart" with selector "table#listing_orders" - Then I should see row 1 and column 1 to have value "R100" with selector "table#listing_orders" - - Scenario: orders listing with sorting - Given the following orders exist: - |created at | completed at | number | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 | - And I go to the admin home page - Then I should see listing orders tabular attributes with completed_at descending - When I follow "Completed At" - Then I should see listing orders tabular attributes with completed_at ascending - When I follow "Order" within "#listing_orders" - Then I should see listing orders tabular attributes with order number ascending - - Scenario: orders search - Given the following orders exist: - |created at | completed at | number | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 | - And I go to the admin home page - When I fill in "search_number_like" with "R200" - When I press "Search" - Then I should see row 1 and column 1 to have value "R200" with selector "table#listing_orders" - - Scenario: Search orders with only completed at input - Given the following orders exist: - |created at | completed at | number | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 | - |2010-01-01 12:36:15 | 2010-01-01 12:36:15 | R200 | - And I go to the admin home page - When I fill in "search_created_at_greater_than" with "2011/01/01" - And I press "Search" - Then I should see listing orders tabular attributes with search result 1 - - Scenario: Search orders with completed at and first name - Given the following orders exist: - |created at | completed at | number | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R100 | - |2011-02-01 12:36:15 | 2011-02-01 12:36:15 | R200 | - |2010-02-01 17:36:42 | 2010-02-01 17:36:42 | R300 | - Given the custom address exists for the given orders - And I go to the admin home page - When I fill in "search_created_at_greater_than" with "2011/01/01" - When I fill in "search_bill_address_firstname_starts_with" with "joh" - And I press "Search" - Then I should see listing orders tabular attributes with search result 2 diff --git a/core/features/admin/orders/order_details.feature b/core/features/admin/orders/order_details.feature deleted file mode 100644 index a2fdb433c75..00000000000 --- a/core/features/admin/orders/order_details.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Admin visiting orders - - Scenario: creating new order - Given the following orders exist: - |completed at | - |2011-02-01 12:36:15 | - |2010-02-01 17:36:42 | - And I go to the admin home page - When I follow "Orders" - Given a product exists with a sku of "a100" - When I follow "admin_new_order" - Then I should see "Add Product" within "#add-line-item" - #Then FIXME TODO select a product and follow the whole chain - - @javascript - Scenario: edit order page with product information - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given product is associated with order - And I go to the admin home page - When I follow "Orders" - When I click first link from selector "table td.actions a" - Then I should see "spree t-shirt" - Then I should see "$39.98" - When I fill in "order_line_items_attributes_0_quantity" with "1" - Then async I should see "Total: $19.99" - - Scenario: new order page comes up - Given the following orders exist: - |completed at | - |2011-02-01 12:36:15 | - |2010-02-01 17:36:42 | - And I go to the admin home page - When I follow "Orders" - Given a product exists with a sku of "a100" - When I follow "admin_new_order" - Then I should see "Add Product" within "#add-line-item" diff --git a/core/features/admin/orders/payments.feature b/core/features/admin/orders/payments.feature deleted file mode 100644 index 27d04d93653..00000000000 --- a/core/features/admin/orders/payments.feature +++ /dev/null @@ -1,84 +0,0 @@ -Feature: Admin managing payments - - @javascript - Scenario: payments list - Given the following orders exist: - |completed at | number | state | - |2011-02-01 12:36:15 | R100 | complete | - Given product is associated with order - Given custom payment associated with order R100 - And I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Payments" - Then I should see "Payment: balance due" within "#payment_status" - Then verify data from "table.index" with following tabular values: - | Date/Time | Amount | Payment Method | Payment State | Actions | - | ignore | $39.98 | Credit Card | pending | ignore | - When I press "Void" - Then I should see "Payment: balance due" within "#payment_status" - Then I should see "Payment Updated" - Then verify data from "table.index" with following tabular values: - | Date/Time | Amount | Payment Method | Payment State | Actions | - | ignore | $39.98 | Credit Card | void | ignore | - When I click first link from selector "#new_payment_section a" - Then I should see "New Payment" - When I press "Update" - When I press "Capture" - Then I should see "Payment: paid" within "#payment_status" - Then I should not see "#new_payment_section" - When I follow "Shipments" - Given a custom shipping method exists - Given custom order has a ship address - When I click first link from selector "#new_shipment_section a" - When I check first element with class "inventory_unit" - When I press "Create" - Then I should see "successfully created!" - When I follow "Shipments" - Then verify data from "table.index" with following tabular values: - | Shipment # | Shipping Method | Cost | Tracking | Status | Date/Time | Action | - | ignore | UPS Ground | $10.00 | ignore | Pending | ignore | ignore | - When I click first link from selector "#new_shipment_section a" - When I check first element with class "inventory_unit" - When I press "Create" - Then I should see "successfully created!" - When I follow "Shipments" - Then verify data from "table.index" with following tabular values: - | Shipment # | Shipping Method | Cost | Tracking | Status | Date/Time | Action | - | ignore | UPS Ground | $10.00 | ignore | Pending | ignore | ignore | - | ignore | UPS Ground | $10.00 | ignore | Pending | ignore | ignore | - - @javascript - Scenario: payments list with history - Given the following orders exist: - |completed at | number | state | - |2011-02-01 12:36:14 | R100 | complete | - Given a completed order - And I go to the admin home page - When I follow the first admin_edit_spree_order link - When I follow "Payments" - Then I should see "Payment: balance due" within "#payment_status" - When I press "Capture" - Then I should see "Payment: paid" within "#payment_status" - Then I should not see "#new_payment_section" - When I follow "Shipments" - Given a custom shipping method exists - Given custom order has a ship address - When I click first link from selector "#new_shipment_section a" - When I check first element with class "inventory_unit" - When I press "Create" - Then I should see "successfully created!" - When I follow "Shipments" - When I click first link from selector "#new_shipment_section a" - When I check first element with class "inventory_unit" - When I press "Create" - Then I should see "successfully created!" - When I follow "Shipments" - When I follow "History" - Then verify data from "table.index" with following tabular values: - | Event | From State | To State | User | Date/Time | - | Payment | paid | balance due | ignore | ignore | - | Shipment | pending | backorder | ignore | ignore | - | Payment | balance due | paid | ignore | ignore | - | Payment | paid | balance due | ignore | ignore | - - diff --git a/core/features/admin/orders/return_authorizations.feature b/core/features/admin/orders/return_authorizations.feature deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/core/features/admin/orders/shipments.feature b/core/features/admin/orders/shipments.feature deleted file mode 100644 index 39b102d16b5..00000000000 --- a/core/features/admin/orders/shipments.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Admin managing shipments - - Scenario: create new shipment - Given all orders are deleted - Given all line items are deleted - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given custom line items associated with products - Given custom order has a ship address - Given product is associated with order - Given custom payment associated with order R100 - Given custom line items associated with products - Given a shipping method exists - And I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Shipments" - When I click first link from selector "#new_shipment_section a" - Given custom inventory units associated with order R100 - When I press "Create" - - - - Scenario: create new shipment with validation error - Given a shipping method exists - Given the following orders exist: - |completed at | number | - |2011-02-01 12:36:15 | R100 | - Given product is associated with order - Given custom payment associated with order R100 - And I go to the admin home page - When I click first link from selector "table td.actions a" - When I follow "Shipments" - When I click first link from selector "#new_shipment_section a" - When I press "Create" - Then I should see "Address firstname can't be blank" - - diff --git a/core/features/admin/products/edit/images.feature b/core/features/admin/products/edit/images.feature deleted file mode 100644 index e15439daf73..00000000000 --- a/core/features/admin/products/edit/images.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Admin editing products - - Scenario: admin uploading and then editing an image for a product - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Images" - When I follow "new_image_link" - When I attach file "ror_ringer.jpeg" to "image_attachment" - When I press "Update" - Then I should see "successfully created!" - When I click first link from selector "table.index a.edit" - When I fill in "image_alt" with "ruby on rails t-shirt" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "ruby on rails t-shirt" diff --git a/core/features/admin/products/edit/option_types.feature b/core/features/admin/products/edit/option_types.feature deleted file mode 100644 index c57aeed72e9..00000000000 --- a/core/features/admin/products/edit/option_types.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Admin editing product's option types - - @javascript - Scenario: editing option type - When I go to the admin home page - When I follow "Products" - When I follow "Option Types" - When I follow "new_option_type_link" - When I fill in "option_type_name" with "shirt colors" - When I fill in "option_type_presentation" with "colors" - When I press "Create" - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Option Types" within "#sidebar" - Then I should see row 1 and column 0 to have value "None" with selector "table.index" - When I click first link from selector "#new_opt_link a" - Then async - Then I wait for 2 seconds - When I click first link from selector "#option-types table a" - Then async - Then I wait for 2 seconds - Then I should see row 1 and column 0 to have value "shirt colors" with selector "table.index" - Then I should see row 1 and column 1 to have value "colors" with selector "table.index" - - - - diff --git a/core/features/admin/products/edit/product_details.feature b/core/features/admin/products/edit/product_details.feature deleted file mode 100644 index 3bfa268ad7f..00000000000 --- a/core/features/admin/products/edit/product_details.feature +++ /dev/null @@ -1,16 +0,0 @@ -Feature: Admin editing products - - Scenario: admin editing a product - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I fill in "product_name" with "apache baseball cap 99" - When I press "Update" - Then I should see "successfully updated!" - diff --git a/core/features/admin/products/edit/product_properties.feature b/core/features/admin/products/edit/product_properties.feature deleted file mode 100644 index 2a12d34185c..00000000000 --- a/core/features/admin/products/edit/product_properties.feature +++ /dev/null @@ -1,57 +0,0 @@ -Feature: Admin editing products - - Background: - Given the following properties exist: - | Name | Presentation | - | model | Model | - | brand | Brand | - | shirt_fabric | Fabric | - | shirt_sleeve_length | Sleeve | - | mug_type | Type | - | bag_type | Type | - | manufacturer | Manufacturer | - | bag_size | Size | - | mug_size | Size | - | gender | Gender | - | shirt_fit | Fit | - | bag_material | Material | - | shirt_type | Type | - Given "Shirt" prototype has properties "brand, gender, manufacturer, model, shirt_fabric, shirt_fit, shirt_sleeve_length, shirt_type" - Given "Mug" prototype has properties "mug_size, mug_type" - Given "Bag" prototype has properties "bag_type, bag_material" - Given custom taxons exist - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Product Properties" - - @javascript - Scenario: admin managing product properties - Then verify empty table for selector "table.index" - When I click first link from selector "p.add_product_properties a" - Then I wait for 2 seconds - When I custom fill in "table tr:last td.property_name input" with "shirt_type" - When I custom fill in "table tr:last td.value input" with "black_shirt" - When I press "Update" - When I follow "Product Properties" - Then I custom should see value "shirt_type" for selector "table tr:last td.property_name input" - Then I custom should see value "black_shirt" for selector "table tr:last td.value input" - When I click first link from selector "table tr:last td.actions a" - Then I wait for 2 seconds - When I press "Update" - When I follow "Product Properties" - Then verify empty table for selector "table.index" - - @javascript - Scenario: admin managing product properties using prototypes - Then verify empty table for selector "table.index" - When I click first link from selector "#new_ptype_link a" - Then I wait for 2 seconds - When I click first link from selector "#prototypes table.index a" - #Then FIXME diff --git a/core/features/admin/products/edit/taxons.feature b/core/features/admin/products/edit/taxons.feature deleted file mode 100644 index 5fc525eb9f1..00000000000 --- a/core/features/admin/products/edit/taxons.feature +++ /dev/null @@ -1,26 +0,0 @@ -Feature: Admin editing products - - @javascript - Scenario: admin managing taxons - Given custom taxons exist - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Taxons" - Then I should see 2 tabular records with selector "#selected-taxons table.index" - Then I should see row 1 and column 0 to have value "None." with selector "#selected-taxons table.index" - When I fill in "searchtext" with "a" - Then async - Then I wait for 2 seconds - Then verify admin taxons listing - When I click first link from selector "#search_hits a.iconlink" - Then I wait for 2 seconds - When I follow "Taxons" - Then I should see 2 tabular records with selector "#selected-taxons table.index" - Then I should see row 1 and column 0 to have value "Brand" with selector "#selected-taxons table.index" diff --git a/core/features/admin/products/edit/variants.feature b/core/features/admin/products/edit/variants.feature deleted file mode 100644 index 3bdf437407a..00000000000 --- a/core/features/admin/products/edit/variants.feature +++ /dev/null @@ -1,67 +0,0 @@ -Feature: Admin managing variants - - @javascript - Scenario: editing option type with no option type - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Variants" within "#sidebar" - Then I should see row 1 and column 0 to have value "None" with selector "table.index" - Then I should see "To add variants, you must first define" - Then I follow "Option Types" within ".first_add_option_types" - When I click first link from selector "#new_opt_link a" - Then I should see "None Available" - - @javascript - Scenario: editing option type with existing option type - When I go to the admin home page - When I follow "Products" - When I follow "Option Types" - When I follow "new_option_type_link" - When I fill in "option_type_name" with "shirt colors" - When I fill in "option_type_presentation" with "colors" - When I press "Create" - Then I should see "successfully created!" - When I click first link from selector "#new_add_option_value a" - Then I wait for 2 seconds - When I custom fill in "table tr:last td.name input" with "color" - When I custom fill in "table tr:last td.presentation input" with "black" - When I press "Update" - Then I should see "successfully updated!" - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Option Types" within "#sidebar" - Then I should see row 1 and column 0 to have value "None" with selector "table.index" - When I click first link from selector "#new_opt_link a" - Then async - Then I wait for 2 seconds - When I click first link from selector "#option-types table a" - Then async - Then I wait for 2 seconds - Then I should see row 1 and column 0 to have value "shirt colors" with selector "table.index" - Then I should see row 1 and column 1 to have value "colors" with selector "table.index" - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Variants" within "#sidebar" - When I click first link from selector "#new_var_link a.new" - Then async - Then I wait for 2 seconds - When I fill in "variant_sku" with "A100" - When I press "Create" - Then I should see "successfully created!" - Then I should see row 1 and column 1 to have value "19.99" with selector "table.index" - Then I should see row 1 and column 2 to have value "A100" with selector "table.index" diff --git a/core/features/admin/products/option_types.feature b/core/features/admin/products/option_types.feature deleted file mode 100644 index b5f5215263c..00000000000 --- a/core/features/admin/products/option_types.feature +++ /dev/null @@ -1,37 +0,0 @@ -Feature: Admin visiting option types - - Scenario: admin visiting option types list - Given 2 option types exist - And I go to the admin home page - When I follow "Products" - When I follow "Option Types" - Then I should see listing option types tabular attributes - - @javascript - Scenario: admin creating a new option type - When I go to the admin home page - When I follow "Products" - When I follow "Option Types" - When I follow "new_option_type_link" - Then I should see "New Option Type" within "#new_option_type" - When I fill in "option_type_name" with "shirt colors" - When I fill in "option_type_presentation" with "colors" - When I press "Create" - Then I should see "successfully created!" - When I click first link from selector "#new_add_option_value a" - Then I wait for 2 seconds - When I custom fill in "table tr:last td.name input" with "color" - When I custom fill in "table tr:last td.presentation input" with "black" - When I press "Update" - Then I should see "successfully updated!" - - Scenario: admin editing an option type - Given 2 option types exist - And I go to the admin home page - When I follow "Products" - When I follow "Option Types" - When I click on first link with class "admin_edit_option_type" - When I fill in "option_type_name" with "foo-size 99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "foo-size 99" diff --git a/core/features/admin/products/product_groups.feature b/core/features/admin/products/product_groups.feature deleted file mode 100644 index d762af18ebd..00000000000 --- a/core/features/admin/products/product_groups.feature +++ /dev/null @@ -1,244 +0,0 @@ -Feature: Admin visiting product groups - - Scenario: Visiting admin product groups page - Given 2 product groups exist - And I go to the admin home page - When I follow "Products" - When I follow "Product Groups" - Then I should see listing product groups tabular attributes - - @javascript - Scenario: creating new product group record - Given I go to the admin home page - When I follow "Products" - When I follow "Product Groups" - When I follow "new_product_group_link" - Then async I should see "Product Group" within "#content" - When I fill in "product_group_name" with "male shirts" - When I press "Create" - Then I should see "successfully created!" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I fill in "product_group_name" with "most popular rails items 99" - When I press "Update" - Then async - And I should see "successfully updated!" - When I follow "Product Groups" - Then I should see "most popular rails items 99" - - - - @javascript - Scenario: applying scope product name have following - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Product name have following" from "product_scope_name" - When I press "Add" - Then async I should see "Product name have following" within "table#product_scopes" - - @javascript - Scenario: applying scope product name or meta keywords have following - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Product name or meta keywords have following" from "product_scope_name" - When I press "Add" - Then async I should see "Product name or meta keywords have following " within "table#product_scopes" - - @javascript - Scenario: applying scope product name or description have following - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Product name or description have following" from "product_scope_name" - When I press "Add" - Then async I should see "Product name or description have following " within "table#product_scopes" - - @javascript - Scenario: applying scope product with ids - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Products with IDs" from "product_scope_name" - When I press "Add" - Then async I should see "Products with IDs" within "table#product_scopes" - - @javascript - Scenario: applying scope product with option and value - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "With option and value" from "product_scope_name" - When I press "Add" - Then async I should see "With option and value" within "table#product_scopes" - - @javascript - Scenario: applying scope product with property - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "With property" from "product_scope_name" - When I press "Add" - Then async I should see "With property" within "table#product_scopes" - - @javascript - Scenario: applying scope product with property value - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "With property value" from "product_scope_name" - When I press "Add" - Then async I should see "With property value" within "table#product_scopes" - - @javascript - Scenario: applying scope product with value - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "With value" from "product_scope_name" - When I press "Add" - Then async I should see "With value" within "table#product_scopes" - - @javascript - Scenario: applying scope product with option - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "With option" from "product_scope_name" - When I press "Add" - Then async I should see "With option" within "table#product_scopes" - - @javascript - Scenario: applying scope product price between - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Price between" from "product_scope_name" - When I press "Add" - Then async I should see "Price between" within "table#product_scopes" - - @javascript - Scenario: applying scope product master price lesser or equal to - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Master price lesser or equal to" from "product_scope_name" - When I press "Add" - Then async I should see "Master price lesser or equal to" within "table#product_scopes" - - @javascript - Scenario: applying scope product master price greater or equal to - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Master price greater or equal to" from "product_scope_name" - When I press "Add" - Then async I should see "Master price greater or equal to" within "table#product_scopes" - - @javascript - Scenario: applying scope In taxons and all their descendants - Given I go to the admin home page - Given a product group exists - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "In taxons and all their descendants" from "product_scope_name" - When I press "Add" - Then async I should see "In taxons and all their descendants" within "table#product_scopes" - - @javascript - Scenario: applying scope In Taxon(without descendants) - Given a product group exists - Given I go to the admin home page - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "In Taxon(without descendants)" from "product_scope_name" - When I press "Add" - Then async I should see "In Taxon(without descendants)" within "table#product_scopes" - - @javascript - Scenario: Visiting admin product groups page to edit it - Given a product group exists - Given the following products exist: - | name | updated_at | - | apache cap | 2011-04-06 17:25:00 | - | ruby on rails t-shirt | 2011-05-06 17:25:00 | - And I go to the admin home page - When I follow "Products" - When I follow "Product Groups" - When I click on first link with class "admin_edit_product_group" - When I select "Ascend by product name" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with ascend by product name - And I should see "successfully updated!" - - When I select "Descend by product name" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with descend by product name - And I should see "successfully updated!" - - When I select "Ascend by actualization date" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with ascend by product name - And I should see "successfully updated!" - - When I select "Descend by actualization date" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with descend by product name - And I should see "successfully updated!" - - Given the price of apache cap is 10 - Given the price of rails t-shirt cap is 30 in product group context - - When I select "Ascend by product master price" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with ascend by product name - And I should see "successfully updated!" - - When I select "Descend by product master price" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with descend by product name - And I should see "successfully updated!" - - Given apache cap has 1 line item - Given ruby on rails t-shirt has 2 line items - - When I select "Sort by popularity(most popular first)" from "product_group_order_scope" - When I press "Update" - Then async - Then I should see product groups products listing with descend by product name - And I should see "successfully updated!" - - diff --git a/core/features/admin/products/products.feature b/core/features/admin/products/products.feature deleted file mode 100644 index 7b8b06652bb..00000000000 --- a/core/features/admin/products/products.feature +++ /dev/null @@ -1,127 +0,0 @@ -Feature: Admin visiting products - - Scenario: admin visiting products listing - Given the following products exist: - | name | available_on | count_on_hand | - | apache baseball cap | 2011-01-06 18:21:13 | 0 | - | zomg shirt | 2125-01-06 18:21:13 | 5 | - And I go to the admin home page - When I follow "Products" - Then I should see listing products tabular attributes with name ascending - When I follow "admin_products_listing_name_title" - Then I should see listing products tabular attributes with name descending - - @selenium - Scenario: admin using search on products listing (show deleted) - Given the following products exist: - | name | available_on | deleted_at | - | apache baseball cap | 2011-01-06 18:21:13 | 2011-01-06 18:21:13 | - | zomg shirt | 2111-01-06 18:21:13 | nil | - Given count_on_hand is 10 for all products - And I go to the admin home page - When I follow "Products" - Then I should see "zomg shirt" - And I should not see "apache baseball cap" - When I check "Show Deleted" - And press "Search" - Then I should see "zomg shirt" - And I should see "apache baseball cap" - When I uncheck "Show Deleted" - And press "Search" - Then I should see "zomg shirt" - And I should not see "apache baseball cap" - - Scenario: admin using search on products listing - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I fill in "search_name_contains" with "ap" - When I press "Search" - Then I should see listing products tabular attributes with custom result 1 - When I fill in "search_variants_including_master_sku_contains" with "A1" - When I press "Search" - Then I should see listing products tabular attributes with custom result 2 - - @javascript - Scenario: admin creating a new product - Given I go to the admin home page - When I follow "Products" - When I follow "admin_new_product" - Then async I should see "SKU" within "#new_product" - When I fill in "product_name" with "Baseball Cap" - When I fill in "product_sku" with "B100" - When I fill in "product_price" with "100" - When I fill in "product_available_on" with "2011/01/24" - When I press "Create" - Then I should see "successfully created!" - When I fill in "product_on_hand" with "100" - When I press "Update" - Then I should see "successfully updated!" - - @javascript - Scenario: admin creating a new product with validation error - Given I go to the admin home page - When I follow "Products" - When I follow "admin_new_product" - Then async I should see "SKU" within "#new_product" - When I press "Create" - Then I should see "Name can't be blank" - Then I should see "Price can't be blank" - - Scenario: admin cloning a product - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.clone" - Then I should see "Product has been cloned" - - Scenario: admin uploading and then editing an image for a product - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Images" - When I follow "new_image_link" - When I attach file "ror_ringer.jpeg" to "image_attachment" - When I press "Update" - Then I should see "successfully created!" - When I click first link from selector "table.index a.edit" - When I fill in "image_alt" with "ruby on rails t-shirt" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "ruby on rails t-shirt" - - @javascript - Scenario: admin managing taxons - Given custom taxons exist - Given the following products exist: - | name | sku | available_on | - | apache baseball cap | A100 | 2011-01-01 01:01:01 | - | apache baseball cap2 | B100 | 2011-01-01 01:01:01 | - | zomg shirt | Z100 | 2011-01-01 01:01:01 | - Given count_on_hand is 10 for all products - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Taxons" - When I fill in "searchtext" with "a" - Then async - Then I wait for 2 seconds - Then verify admin taxons listing - When I click first link from selector "#search_hits a" - Then async diff --git a/core/features/admin/products/properties.feature b/core/features/admin/products/properties.feature deleted file mode 100644 index 74b5df3ce65..00000000000 --- a/core/features/admin/products/properties.feature +++ /dev/null @@ -1,41 +0,0 @@ -Feature: Admin visiting properties - - Scenario: admin visiting properties list page - Given 2 properties exist - And I go to the admin home page - When I follow "Products" - When I follow "Properties" - Then I should see listing properties tabular attributes - - @javascript - Scenario: admin creating a new property - When I go to the admin home page - When I follow "Products" - When I follow "Properties" - When I follow "new_property_link" - Then async I should see "New Property" within "#new_property" - When I fill in "property_name" with "color of band" - When I fill in "property_presentation" with "color" - When I press "Create" - Then I should see "successfully created!" - - Scenario: admin editing a property - Given a property exists - When I go to the admin home page - When I follow "Products" - When I follow "Properties" - When I click first link from selector "table#listing_properties a.edit" - When I fill in "property_name" with "model 99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "model 99" - - Scenario: admin editing a property with validation error - Given a property exists - When I go to the admin home page - When I follow "Products" - When I follow "Properties" - When I click first link from selector "table#listing_properties a.edit" - When I fill in "property_name" with "" - When I press "Update" - Then I should see "Name can't be blank" diff --git a/core/features/admin/products/prototypes.feature b/core/features/admin/products/prototypes.feature deleted file mode 100644 index c16485a079e..00000000000 --- a/core/features/admin/products/prototypes.feature +++ /dev/null @@ -1,47 +0,0 @@ -Feature: Admin visiting prototypes - - Scenario: Visiting admin prototypes page - Given the following properties exist: - | Name | Presentation | - | model | Model | - | brand | Brand | - | shirt_fabric | Fabric | - | shirt_sleeve_length | Sleeve | - | mug_type | Type | - | bag_type | Type | - | manufacturer | Manufacturer | - | bag_size | Size | - | mug_size | Size | - | gender | Gender | - | shirt_fit | Fit | - | bag_material | Material | - | shirt_type | Type | - Given "Shirt" prototype has properties "brand, gender, manufacturer, model, shirt_fabric, shirt_fit, shirt_sleeve_length, shirt_type" - Given "Mug" prototype has properties "mug_size, mug_type" - Given "Bag" prototype has properties "bag_type, bag_material" - And I go to the admin home page - When I follow "Products" - When I follow "Prototypes" - Then verify data from "table.index" with following tabular values: - | Name | Action | - | Shirt | ignore | - | Mug | ignore | - | Bag | ignore | - - - @javascript - Scenario: Visiting admin prototypes page to create new record - When I go to the admin home page - When I follow "Products" - When I follow "Prototypes" - When I follow "new_prototype_link" - Then async I should see "New Prototype" within "#new_prototype" - When I fill in "prototype_name" with "male shirts" - When I press "Create" - Then I should see "successfully created!" - When I follow "Prototypes" - When I click on first link with class "admin_edit_prototype" - When I fill in "prototype_name" with "Shirt 99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "Shirt 99" diff --git a/core/features/admin/products/variant.feature b/core/features/admin/products/variant.feature deleted file mode 100644 index 1f2df6dd52d..00000000000 --- a/core/features/admin/products/variant.feature +++ /dev/null @@ -1,18 +0,0 @@ -Feature: Admin product variants - - Scenario: admin creates a new variant - Given the following product with option types exist: - | price | cost_price | weight | height | width | depth | - | 1.99 | 1.00 | 2.5 | 3.0 | 1.0 | 1.5 | - Given 2 option types exist - When I go to the admin home page - When I follow "Products" - When I click first link from selector "table#listing_products a.edit" - When I follow "Variants" - When I follow "New Variant" - Then the "variant_price" field should contain "1.99" - And the "variant_cost_price" field should contain "1.00" - And the "variant_weight" field should contain "2.5" - And the "variant_height" field should contain "3.0" - And the "variant_width" field should contain "1.0" - And the "variant_depth" field should contain "1.5" diff --git a/core/features/admin/reports.feature b/core/features/admin/reports.feature deleted file mode 100644 index 39ee7a2078a..00000000000 --- a/core/features/admin/reports.feature +++ /dev/null @@ -1,20 +0,0 @@ -Feature: Admin visiting reports - - Scenario: Visiting admin reports page - Given I go to the admin home page - When I follow "Reports" - When I follow "Sales Total" - Then I should see "Sales Totals" - Then I should see "Item Total" - Then I should see "Adjustment Total" - Then I should see "Sales Total" - - Scenario: search - Given the custom orders exist for reports feature - Given I go to the admin home page - When I follow "Reports" - When I follow "Sales Total" - When I fill in "search_created_at_greater_than" with "2011/01/01" - When I fill in "search_created_at_less_than" with "2011/12/31" - When I press "Search" - Then I should see "$300.00" diff --git a/core/features/admin/users.feature b/core/features/admin/users.feature deleted file mode 100644 index 3fe7261c898..00000000000 --- a/core/features/admin/users.feature +++ /dev/null @@ -1,77 +0,0 @@ -Feature: Admin visiting users - - Scenario: users index page with sorting - Given I go to the admin home page - Given existing user records are deleted - Given the following users exist: - | email | - | a@example.com | - | b@example.com | - When I follow "Users" - Then I should see "Listing Users" - When I follow "users_email_title" - Then I should see listing users tabular attributes with order email asc - When I follow "users_email_title" - Then I should see listing users tabular attributes with order email desc - - Scenario: search - Given I go to the admin home page - Given existing user records are deleted - Given the following users exist: - | email | - | a@example.com | - | b@example.com | - When I follow "Users" - When I fill in "search_email_contains" with "a@example.com" - And I press "Search" - Then I should see listing users tabular attributes for search result case - - Scenario: users show page - Given I go to the admin home page - Given existing user records are deleted - Given the following users exist: - | email | - | a@example.com | - | b@example.com | - When I follow "Users" - When I click first link from selector "table#listing_users td.user_email a" - Then I should see "User Account" - Then I should see "a@example.com" - Then I click first link from selector "a.edit_user" - Then I should see "Editing User" - - Scenario: edit user email - Given I go to the admin home page - Given existing user records are deleted - Given the following users exist: - | email | - | a@example.com | - | b@example.com | - When I follow "Users" - When I click first link from selector "table#listing_users td.user_email a" - Then I should see "User Account" - Then I should see "a@example.com" - Then I click first link from selector "a.edit_user" - Then I should see "Editing User" - When I fill in "user_email" with "a@example.com99" - When I press "Update" - Then I should see "successfully updated!" - Then I should see "a@example.com99" - - Scenario: edit user password - Given I go to the admin home page - Given existing user records are deleted - Given the following users exist: - | email | - | a@example.com | - | b@example.com | - When I follow "Users" - When I click first link from selector "table#listing_users td.user_email a" - Then I should see "User Account" - Then I should see "a@example.com" - Then I click first link from selector "a.edit_user" - Then I should see "Editing User" - When I fill in "user_password" with "welcome" - When I fill in "user_password_confirmation" with "welcome" - When I press "Update" - Then I should see "successfully updated!" diff --git a/core/features/checkout.feature b/core/features/checkout.feature deleted file mode 100644 index f8a48af531b..00000000000 --- a/core/features/checkout.feature +++ /dev/null @@ -1,19 +0,0 @@ -Feature: Checkout - In order to buy stuff - As a user - I should be warned about out of stock items - - @selenium @stop - Scenario: Visitor make checkout as guest, without registration - Given backordering is disabled - When I add a product with name: "RoR Mug" to cart - Then I should see "Shopping Cart" within "h1" - Then product with name: "RoR Mug" goes out of stock - When I follow "Checkout" - Then I should see "An item in your cart has become unavailable." - Then I should see "Out of Stock" within "span.out-of-stock" - - When I click first link from selector "a.delete" - When I add a product with name: "RoR Shirt" to cart - When I follow "Checkout" - Then I should see "Checkout" within "h1" diff --git a/core/features/products.feature b/core/features/products.feature deleted file mode 100644 index 25186b62cd3..00000000000 --- a/core/features/products.feature +++ /dev/null @@ -1,74 +0,0 @@ -Feature: Visiting products - - Background: - Given the following taxonomies exist: - | name | - | Brand | - | Categories | - Given the custom taxons and custom products exist - Given backordering is enabled - - Scenario: show page - When I go to the home page - When I click first link from selector "ul.product-listing a" - Then I should see "$17.99" - When I click first link from selector "form button.primary" - Then I should see "Shopping Cart" - - Scenario: visit products page - When I go to the home page - When I fill in "keywords" with "shirt" - When I press "Search" - Then verify products listing for top search result - - Scenario: visit brand Ruby on Rails - When I go to the home page - When I follow "Ruby on Rails" - Then verify products listing for Ruby on Rails brand - - Scenario: visit brand Ruby - When I go to the home page - When I follow "Ruby" - Then verify products listing for Ruby brand - - Scenario: visit brand Apache - When I go to the home page - When I follow "Apache" - Then verify products listing for Apache brand - - Scenario: visit category Clothing - When I go to the home page - When I follow "Clothing" - Then verify products listing for Clothing category - - Scenario: visit category Mugs - When I go to the home page - When I follow "Mugs" - Then verify products listing for Mugs category - - Scenario: visit category Bags - When I go to the home page - When I follow "Bags" - Then verify products listing for Bags category - - Scenario: select under 10 - When I go to the home page - When I follow "Ruby on Rails" - When I check "Price_Range_Under_$10" - When I press "Search" within "#sidebar_products_search" - Then I should see "No products found" - - Scenario: select between 15 and 18 - When I go to the home page - When I follow "Ruby on Rails" - When I check "Price_Range_$15_-_$18" - When I press "Search" within "#sidebar_products_search" - Then verify products listing for price range search 15-18 - - Scenario: select 18 and above - When I go to the home page - When I follow "Ruby on Rails" - When I check "Price_Range_$18_-_$20" - When I check "Price_Range_$20_or_over" - When I press "Search" within "#sidebar_products_search" - Then verify products listing for price range search 18 and above diff --git a/core/features/step_definitions/admin/configurations.rb b/core/features/step_definitions/admin/configurations.rb deleted file mode 100644 index 8a77ce1d306..00000000000 --- a/core/features/step_definitions/admin/configurations.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Ideally this step should not be needed but without a default configuration file -# cuke is running into some weird database transaction issue where the record -# is created but the self.stored_preferences.build({}).owner is returning nil -# This step fixes it -Given /^default configuration file exists$/ do - Spree::AppConfiguration.find_or_create_by_name('Default configuration') -end - -Then /^I should see listing shipping methods tabular attributes$/ do - output = tableish('table#listing_shipping_methods tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Zone' - data[2].should == 'Calculator' - data[3].should == 'Display' - - data = output[1] - #data[0].should == Spree::Taxonomy.limit(1).order('name asc').to_a.first.name -end - -Then /^I should see listing states tabular attributes$/ do - output = tableish('table#listing_states tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Abbreviation' - - data = output[1] - data[0].should == Spree::State.limit(1).order('name ASC').to_a.first.name - data[1].should == Spree::State.limit(1).order('name ASC').to_a.first.abbr -end - -Then /^I should see listing zones tabular attributes with (.*)$/ do |order| - output = tableish('table#listing_zones tr', 'td,th') - data = output[0] - data[0].should match(/Name/) - data[1].should match(/Description/) - - data = output[1] - data[0].should == Spree::Zone.limit(1).order(order).to_a.first.name - data[0].should == 'eastern' if order == 'name ASC' - data[0].should == 'western' if order == 'description ASC' - data[1].should == Spree::Zone.limit(1).order(order).to_a.first.description -end - - -Then /^verify tabular data for tracker index$/ do - output = tableish('table.index tr', 'td,th') - data = output[0] - data[0].should == 'Analytics ID' - data[1].should == 'Environment' - data[2].should == 'Active' - data[3].should == 'Action' - - data = output[1] - data[0].should == 'A100' - data[1].should == 'Cucumber' - data[2].should == 'Yes' -end diff --git a/core/features/step_definitions/admin/configurations/mail_methods.rb b/core/features/step_definitions/admin/configurations/mail_methods.rb deleted file mode 100644 index 88d7884403d..00000000000 --- a/core/features/step_definitions/admin/configurations/mail_methods.rb +++ /dev/null @@ -1,11 +0,0 @@ -Then /^I should see tabular data for mail methods index$/ do - output = tableish('table#mail_methods_listing tr', 'td,th') - # FIXME not sure why it is not working - #data = output[0] - #data[0].should == 'Environment' - #data[1].should == 'Active' - - data = output[0] - data[0].should == 'Cucumber' - data[1].should == 'Yes' -end diff --git a/core/features/step_definitions/admin/configurations/payment_method.rb b/core/features/step_definitions/admin/configurations/payment_method.rb deleted file mode 100644 index cb94631b9f3..00000000000 --- a/core/features/step_definitions/admin/configurations/payment_method.rb +++ /dev/null @@ -1,13 +0,0 @@ -Then /^I should see listing payment methods tabular attributes$/ do - output = tableish('table#listing_payment_methods tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Provider' - data[2].should == 'Environment' - data[3].should == 'Display' - data[4].should == 'Active' - - data = output[1] - data[0].should == 'Check' - data[1].should == 'Spree::PaymentMethod::Check' -end diff --git a/core/features/step_definitions/admin/configurations/tax_categories.rb b/core/features/step_definitions/admin/configurations/tax_categories.rb deleted file mode 100644 index 114283b3457..00000000000 --- a/core/features/step_definitions/admin/configurations/tax_categories.rb +++ /dev/null @@ -1,10 +0,0 @@ -Then /^I should see tabular data for tax categories index$/ do - output = tableish('table#listing_tax_categories tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Description' - data[2].should == 'Default' - - data = output[1] - data[0].should == Spree::TaxCategory.limit(1).order('name ASC').to_a.first.name -end diff --git a/core/features/step_definitions/admin/configurations/taxonomies.rb b/core/features/step_definitions/admin/configurations/taxonomies.rb deleted file mode 100644 index b41af255afa..00000000000 --- a/core/features/step_definitions/admin/configurations/taxonomies.rb +++ /dev/null @@ -1,8 +0,0 @@ -Then /^I should see tabular data for taxonomies list$/ do - output = tableish('table#listing_taxonomies tr', 'td,th') - data = output[0] - data[0].should == 'Name' - - data = output[1] - data[0].should == Spree::Taxonomy.limit(1).order('name ASC').to_a.first.name -end diff --git a/core/features/step_definitions/admin/option_types.rb b/core/features/step_definitions/admin/option_types.rb deleted file mode 100644 index 28d9f9a5e3b..00000000000 --- a/core/features/step_definitions/admin/option_types.rb +++ /dev/null @@ -1,9 +0,0 @@ -Then /^I should see listing option types tabular attributes$/ do - output = tableish('table#listing_option_types tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Presentation' - - data = output[1] - data[0].should == Spree::OptionType.limit(1).order('position ASC').to_a.first.name -end diff --git a/core/features/step_definitions/admin/orders.rb b/core/features/step_definitions/admin/orders.rb deleted file mode 100644 index 0d6f4ca3614..00000000000 --- a/core/features/step_definitions/admin/orders.rb +++ /dev/null @@ -1,68 +0,0 @@ -Given /^a custom shipping method exists$/ do - Spree::ShippingMethod.delete_all - Factory(:shipping_method, :zone => Spree::Zone.find_by_name('North America')) -end - -Given /^custom next on order$/ do - order = Spree::Order.find_by_number('R100') - order.next! -end - -Given /^custom order has a ship address$/ do - order = Spree::Order.find_by_number('R100') - order.ship_address = Factory(:address) - order.save! -end - -Given /^product is associated with order$/ do - order = Spree::Order.last - product = Factory(:product, :name => 'spree t-shirt') - order.add_variant(product.master, 2) - order.inventory_units.each do |iu| - iu.update_attribute_without_callbacks('state', 'sold') - end -end - -Given /^preference settings exist$/ do - @configuration ||= Spree::AppConfiguration.find_or_create_by_name('Default configuration') - Spree::Preference.create(:name => 'allow_ssl_in_production', :owner => @configuration, :value => '1') - Spree::Preference.create(:name => 'site_url', :owner => @configuration, :value => 'demo.spreecommerce.com') - Spree::Preference.create(:name => 'allow_ssl_in_development_and_test', :owner => @configuration, :value => '0') - Spree::Preference.create(:name => 'site_name', :owner => @configuration, :value => 'Spree Demo Site') -end - -Given /^custom line items associated with products$/ do - Spree::Order.all.each do |order| - Factory(:line_item, :order => order) - end -end - -When /^I follow the first admin_edit_spree_order link$/ do - order = Spree::Order.order('completed_at DESC').first - title = "admin_edit_spree_order_#{order.id}" - click_link(title) -end - -Given /^the custom address exists for the given orders$/ do - orders = Spree::Order.order('id ASC').all - raise 'there should be only three ordres' unless Spree::Order.count == 3 - - o = orders[0] - address = Factory(:address, :firstname => 'john') - o.bill_address = address - o.ship_address = address - o.save - - o = orders[1] - address = Factory(:address, :firstname => 'john') - address = Factory(:address, :firstname => 'mary') - o.bill_address = address - o.ship_address = address - o.save - - o = orders[2] - address = Factory(:address, :firstname => 'angelina') - o.bill_address = address - o.ship_address = address - o.save -end diff --git a/core/features/step_definitions/admin/product_groups.rb b/core/features/step_definitions/admin/product_groups.rb deleted file mode 100644 index d0bcd32478d..00000000000 --- a/core/features/step_definitions/admin/product_groups.rb +++ /dev/null @@ -1,61 +0,0 @@ -Then /^I should see listing product groups tabular attributes$/ do - output = tableish('table#listing_product_groups tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'URL' - data[2].should == 'Product scopes' - data[3].should == 'Product count' - data[4].should == 'Action' - - data = output[1] - data[0].should == Spree::ProductGroup.limit(1).order('name DESC').to_a.first.name -end - -Then /^I should see product groups products listing with (.*) by product name$/ do |direction| - output = tableish('table.index tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Action' - - data = output[1] - first_item = data[0] - - data = output[2] - second_item = data[0] - - if direction == 'ascend' - first_item.should == 'apache cap' - second_item.should == 'ruby on rails t-shirt' - else - second_item.should == 'apache cap' - first_item.should == 'ruby on rails t-shirt' - end - -end - -Given /^the price of apache cap is 10$/ do - product = Spree::Product.find_by_name('apache cap') - master = product.master - master.price = 10.00 - master.save -end - -Given /^the price of rails t-shirt cap is 30 in product group context$/ do - product = Spree::Product.find_by_name('ruby on rails t-shirt') - master = product.master - master.price = 30.00 - master.save -end - -Given /^apache cap has 1 line item$/ do - product = Spree::Product.find_by_name('apache cap') - master = product.master - Factory(:line_item, :variant => master) -end - -Given /^ruby on rails t-shirt has 2 line items$/ do - product = Spree::Product.find_by_name('ruby on rails t-shirt') - master = product.master - Factory(:line_item, :variant => master) - Factory(:line_item, :variant => master) -end diff --git a/core/features/step_definitions/admin/products.rb b/core/features/step_definitions/admin/products.rb deleted file mode 100644 index 288fea0f796..00000000000 --- a/core/features/step_definitions/admin/products.rb +++ /dev/null @@ -1,39 +0,0 @@ -Given /^count_on_hand is 10 for all products$/ do - Spree::Product.update_all :count_on_hand => 10 -end - -Then /^I should see listing products tabular attributes with name ascending$/ do - output = tableish('table#listing_products tr', 'td,th') - data = output[0] - data[0].should == 'SKU' - data[1].should match(/Name/) - data[2].should == 'Master Price' - - data = output[1] - data[1].should == 'apache baseball cap' -end - -Then /^I should see listing products tabular attributes with name descending$/ do - output = tableish('table#listing_products tr', 'td,th') - data = output[1] - data[1].should == 'zomg shirt' -end - -Then /^I should see listing products tabular attributes with custom result 1$/ do - output = tableish('table#listing_products tr', 'td,th') - output.size.should == 3 - data = output[1] - data[1].should == 'apache baseball cap' -end - -Then /^I should see listing products tabular attributes with custom result 2$/ do - output = tableish('table#listing_products tr', 'td,th') - output.size.should == 2 - data = output[1] - data[1].should == 'apache baseball cap' -end - -Given /^a product exists with a sku of "([^"]*)"$/ do |sku| - Factory(:product, :sku => sku) -end - diff --git a/core/features/step_definitions/admin/products/images.rb b/core/features/step_definitions/admin/products/images.rb deleted file mode 100644 index ab47d3a8b50..00000000000 --- a/core/features/step_definitions/admin/products/images.rb +++ /dev/null @@ -1,4 +0,0 @@ -When /^I attach file "(.*)" to "(.*)"$/ do |file_name, field| - absolute_path = File.expand_path(Rails.root.join('..', '..', 'features', 'step_definitions', file_name)) - When %Q{I attach the file "#{absolute_path}" to "#{field}"} -end diff --git a/core/features/step_definitions/admin/products/product_properties.rb b/core/features/step_definitions/admin/products/product_properties.rb deleted file mode 100644 index 7ffc2eb45a4..00000000000 --- a/core/features/step_definitions/admin/products/product_properties.rb +++ /dev/null @@ -1,9 +0,0 @@ -When /^I custom fill in "(.*)" with "(.*)"$/ do |selector, value| - node = page.find(selector) - node.set(value) -end - -Then /^I custom should see value "(.*)" for selector "(.*)"$/ do |value, selector| - node = page.first(selector) - node.value.should == value -end diff --git a/core/features/step_definitions/admin/products/taxons.rb b/core/features/step_definitions/admin/products/taxons.rb deleted file mode 100644 index cb19990a339..00000000000 --- a/core/features/step_definitions/admin/products/taxons.rb +++ /dev/null @@ -1,19 +0,0 @@ -Then /^I should see (.*) tabular records with selector "(.*)"$/ do |count, selector| - output = tableish("#{selector} tr", "td,th") - output.size.should == count.to_i -end - -Given /^custom taxons exist$/ do - taxon = Factory(:taxon, :name => 'Brands') - taxon2 = Factory(:taxon, :taxonomy => taxon.taxonomy, :parent_id => taxon.id, :name => 'Apache') -end - -Then /^verify admin taxons listing$/ do - output = tableish('#search_hits table.index tr', 'td,th') - output.size.should == 4 - output[0].should == %w(Name Path Action) - output[1].should == ['Brand','','Select'] - output[2].should == ['Brands','','Select'] - output[3].should == %w(Apache Brands Select) -end - diff --git a/core/features/step_definitions/admin/properties.rb b/core/features/step_definitions/admin/properties.rb deleted file mode 100644 index e186ef0c407..00000000000 --- a/core/features/step_definitions/admin/properties.rb +++ /dev/null @@ -1,16 +0,0 @@ -Then /^I should see listing properties tabular attributes$/ do - output = tableish('table#listing_properties tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Presentation' - - data = output[1] - data[0].should == Spree::Property.limit(1).order('name asc').to_a.first.name -end - -Given /^"(.*)" prototype has properties "(.*)"$/ do |prototype_name, properties| - p = Spree::Prototype.create!(:name => prototype_name) - properties.split(',').each do |property| - p.properties << Spree::Property.find_by_name(property.strip) - end -end diff --git a/core/features/step_definitions/admin/prototypes.rb b/core/features/step_definitions/admin/prototypes.rb deleted file mode 100644 index 22ddf57fc2e..00000000000 --- a/core/features/step_definitions/admin/prototypes.rb +++ /dev/null @@ -1,9 +0,0 @@ -Then /^I should see listing prototypes tabular attributes$/ do - output = tableish('table#listing_prototypes tr', 'td,th') - data = output[0] - data[0].should == 'Name' - data[1].should == 'Action' - - data = output[1] - data[0].should == Spree::Prototype.limit(1).order('name ASC').to_a.first.name -end diff --git a/core/features/step_definitions/admin/reports.rb b/core/features/step_definitions/admin/reports.rb deleted file mode 100644 index ef748fe4efd..00000000000 --- a/core/features/step_definitions/admin/reports.rb +++ /dev/null @@ -1,23 +0,0 @@ -Given /^the custom orders exist for reports feature$/ do - order = Factory(:order) - order.update_attributes_without_callbacks({:adjustment_total => 100}) - order.completed_at = Time.now - order.save! - - order = Factory(:order) - order.update_attributes_without_callbacks({:adjustment_total => 200}) - order.completed_at = Time.now - order.save! - - order = Factory(:order) - order.update_attributes_without_callbacks({:adjustment_total => 200}) - order.completed_at = 3.years.ago - order.created_at = 3.years.ago - order.save! - - order = Factory(:order) - order.update_attributes_without_callbacks({:adjustment_total => 200}) - order.completed_at = 3.years.from_now - order.created_at = 3.years.from_now - order.save! -end diff --git a/core/features/step_definitions/admin/users.rb b/core/features/step_definitions/admin/users.rb deleted file mode 100644 index 0925f72a801..00000000000 --- a/core/features/step_definitions/admin/users.rb +++ /dev/null @@ -1,15 +0,0 @@ -Then /^I should see listing users tabular attributes with order (.*)$/ do |order| - output = tableish('table#listing_users tr', 'td,th') - data = output[0] - data[0].should match(/User/) - - data = output[1] - data[0].should == Spree::User.limit(1).order(order).to_a.first.email -end - -Then /^I should see listing users tabular attributes for search result case$/ do - output = tableish('table#listing_users tr', 'td,th') - output.size.should == 2 - data = output[1] - data[0].should == 'a@example.com' -end diff --git a/core/features/step_definitions/orders/adjustments.rb b/core/features/step_definitions/orders/adjustments.rb deleted file mode 100644 index 9c2703648b2..00000000000 --- a/core/features/step_definitions/orders/adjustments.rb +++ /dev/null @@ -1,8 +0,0 @@ -When /^I follow 'New Adjustment' custom$/ do - page.first('#content .toolbar .actions li a').click -end - -Given /^an adjustment exists for order R100$/ do - order = Spree::Order.find_by_number('R100') - Factory(:adjustment, :order => order) -end diff --git a/core/features/step_definitions/orders/history.rb b/core/features/step_definitions/orders/history.rb deleted file mode 100644 index 0b4358cf95c..00000000000 --- a/core/features/step_definitions/orders/history.rb +++ /dev/null @@ -1,19 +0,0 @@ -Given /^the order is finalized$/ do - order = Spree::Order.last - order.finalize! -end - -Then /^I should see order history tabular attributes$/ do - output = tableish('table.index tr', 'td,th') - data = output[0] - data[0].should == 'Event' - data[1].should == 'From State' - data[2].should == 'To State' - data[3].should == 'User' - data[4].should == 'Date/Time' - - data = output[1] - data[0].should == 'Order' - data[1].should == 'cart' - data[2].should == 'complete' -end diff --git a/core/features/step_definitions/orders/order_details.rb b/core/features/step_definitions/orders/order_details.rb deleted file mode 100644 index 31cc05e48aa..00000000000 --- a/core/features/step_definitions/orders/order_details.rb +++ /dev/null @@ -1,67 +0,0 @@ -Then /^I should see listing orders tabular attributes with created_at descending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[0] - data[0].should match(/Completed At/) - data[1].should == 'Order' - data[2].should == 'Status' - data[3].should == 'Payment State' - data[4].should == 'Shipment State' - data[5].should == 'Customer' - data[6].should == 'Total' - - data = output[1] - data[0].should == Spree::Order.limit(1).order('completed_at desc').to_a.first.created_at.strftime('%Y-%m-%d') -end - -Then /^I should see listing orders tabular attributes with created_at ascending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[0].should == Spree::Order.limit(1).order('completed_at asc').to_a.first.created_at.strftime('%Y-%m-%d') -end - -Then /^I should see listing orders tabular attributes with completed_at descending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[0] - data[0].should match(/Completed At/) - data[1].should == 'Order' - data[2].should == 'Status' - data[3].should == 'Payment State' - data[4].should == 'Shipment State' - data[5].should == 'Customer' - data[6].should == 'Total' - - data = output[1] - data[0].should == Spree::Order.limit(1).order('created_at desc').to_a.first.created_at.strftime('%Y-%m-%d') -end - -Then /^I should see listing orders tabular attributes with completed_at ascending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[0].should == Spree::Order.limit(1).order('created_at asc').to_a.first.created_at.strftime('%Y-%m-%d') -end - -Then /^I should see listing orders tabular attributes with order number ascending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[1].should == Spree::Order.limit(1).order('number asc').to_a.first.number -end - -Then /^I should see listing orders tabular attributes with order number descending$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[1].should == Spree::Order.limit(1).order('number desc').to_a.first.number -end - -Then /^I should see listing orders tabular attributes with search result 1$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[1].should == 'R100' - output.size.should == 2 -end - -Then /^I should see listing orders tabular attributes with search result 2$/ do - output = tableish('table#listing_orders tr', 'td,th') - data = output[1] - data[1].should == 'R100' - output.size.should == 2 -end diff --git a/core/features/step_definitions/orders/payments.rb b/core/features/step_definitions/orders/payments.rb deleted file mode 100644 index 4d3bc4b72f1..00000000000 --- a/core/features/step_definitions/orders/payments.rb +++ /dev/null @@ -1,31 +0,0 @@ -Given /^custom payment associated with order R100$/ do - order = Spree::Order.find_by_number('R100') - Factory(:payment, :order => order, :amount => order.outstanding_balance) -end - -Given /^a completed order$/ do - address = Factory(:address) - - order = Spree::Order.find_by_number('R100') - order.update_attributes(:bill_address_id => address.id, :ship_address_id => address.id) - - payment = Factory(:payment, :order_id => order.id, :amount => 30.00) - - product = Factory(:product, :name => 'spree t-shirt') - - shipment = Factory.build(:shipment, :order_id => order.id) - - inventory_unit = Factory.build(:inventory_unit, :variant_id => product.master.id, - :order_id => order.id) - - shipment.inventory_units << inventory_unit - - shipment.save! - - line_item = Factory(:line_item, :order_id => order.id, - :variant_id => product.master.id, - :quantity => 2, - :price => 10) - -end - diff --git a/core/features/step_definitions/orders/shipments.rb b/core/features/step_definitions/orders/shipments.rb deleted file mode 100644 index 7a8ec97d0cd..00000000000 --- a/core/features/step_definitions/orders/shipments.rb +++ /dev/null @@ -1,9 +0,0 @@ -Given /^custom shipment associated with order R100$/ do - order = Spree::Order.find_by_number('R100') - Factory(:shipment, :order => order) -end - -Given /^custom inventory units associated with order R100$/ do - order = Spree::Order.find_by_number('R100') - Factory(:inventory_unit, :order => order) -end diff --git a/core/features/step_definitions/product.rb b/core/features/step_definitions/product.rb deleted file mode 100644 index 2171fa91f49..00000000000 --- a/core/features/step_definitions/product.rb +++ /dev/null @@ -1,132 +0,0 @@ -Given /^the custom taxons and custom products exist$/ do - - taxonomy = Spree::Taxonomy.find_by_name('Categories') - root = taxonomy.root - clothing_taxon = taxonomy.taxons.create(:name => 'Clothing', :parent_id => root.id) - bags_taxon = taxonomy.taxons.create(:name => 'Bags', :parent_id => root.id) - mugs_taxon = taxonomy.taxons.create(:name => 'Mugs', :parent_id => root.id) - - taxonomy = Spree::Taxonomy.find_by_name('Brand') - root = taxonomy.root - taxon = taxonomy.taxons.create(:name => 'Ruby on Rails', :parent_id => root.id) - - product = Factory(:product, :name => 'Ruby on Rails Ringer T-shirt', :price => '17.99') - product.taxons << taxon - product.taxons << clothing_taxon - - product = Factory(:product, :name => 'Ruby on Rails Mug', :price => '13.99') - product.taxons << taxon - product.taxons << mugs_taxon - - product = Factory(:product, :name => 'Ruby on Rails Tote', :price => '15.99') - product.taxons << taxon - product.taxons << bags_taxon - - product = Factory(:product, :name => 'Ruby on Rails Bag', :price => '22.99') - product.taxons << taxon - product.taxons << bags_taxon - - product = Factory(:product, :name => 'Ruby on Rails Baseball Jersey', :price => '19.99') - product.taxons << taxon - product.taxons << clothing_taxon - - product = Factory(:product, :name => 'Ruby on Rails Stein', :price => '16.99') - product.taxons << taxon - product.taxons << mugs_taxon - - product = Factory(:product, :name => 'Ruby on Rails Jr. Spaghetti', :price => '19.99') - product.taxons << taxon - product.taxons << clothing_taxon - - taxon = taxonomy.taxons.create(:name => 'Ruby', :parent_id => root.id) - product = Factory(:product, :name => 'Ruby Baseball Jersey', :price => '19.99') - product.taxons << taxon - product.taxons << clothing_taxon - - taxon = taxonomy.taxons.create(:name => 'Apache', :parent_id => root.id) - product = Factory(:product, :name => 'Apache Baseball Jersey', :price => '19.99') - product.taxons << taxon - product.taxons << clothing_taxon - -end - -Then /^verify products listing for top search result$/ do - page.all('ul.product-listing li').size.should == 1 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby on Rails Ringer T-shirt'] -end - -Then /^verify products listing for Ruby on Rails brand$/ do - page.all('ul.product-listing li').size.should == 7 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - array = ['Ruby on Rails Bag', - 'Ruby on Rails Baseball Jersey', - 'Ruby on Rails Jr. Spaghetti', - 'Ruby on Rails Mug', - 'Ruby on Rails Ringer T-shirt', - 'Ruby on Rails Stein', - 'Ruby on Rails Tote'] - tmp.sort!.should == array -end - -Then /^verify products listing for Ruby brand$/ do - page.all('ul.product-listing li').size.should == 1 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby Baseball Jersey'] -end - -Then /^verify products listing for Apache brand$/ do - page.all('ul.product-listing li').size.should == 1 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Apache Baseball Jersey'] -end - -Then /^verify products listing for Clothing category$/ do - page.all('ul.product-listing li').size.should == 5 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Apache Baseball Jersey', - 'Ruby Baseball Jersey', - 'Ruby on Rails Baseball Jersey', - 'Ruby on Rails Jr. Spaghetti', - 'Ruby on Rails Ringer T-shirt'] -end - -Then /^verify products listing for Bags category$/ do - page.all('ul.product-listing li').size.should == 2 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby on Rails Bag', 'Ruby on Rails Tote'] -end - -Then /^verify products listing for Mugs category$/ do - page.all('ul.product-listing li').size.should == 2 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby on Rails Mug', 'Ruby on Rails Stein'] -end - -Then /^verify products listing for price range search 15-18$/ do - page.all('ul.product-listing li').size.should == 3 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby on Rails Ringer T-shirt', 'Ruby on Rails Stein', 'Ruby on Rails Tote'] -end - -Then /^verify products listing for price range search 18 and above$/ do - page.all('ul.product-listing li').size.should == 3 - tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact - tmp.delete('') - tmp.sort!.should == ['Ruby on Rails Bag', - 'Ruby on Rails Baseball Jersey', - 'Ruby on Rails Jr. Spaghetti'] -end - -Then /^I should get a "(\d+) ([^']+)" response$/ do |http_status, message| - #response.status.should == "#{http_status} #{message}" # webrat - page.driver.status_code.should == http_status.to_i # capybara -end diff --git a/core/features/support/env.rb b/core/features/support/env.rb deleted file mode 100644 index 4da673bf7ed..00000000000 --- a/core/features/support/env.rb +++ /dev/null @@ -1,4 +0,0 @@ -FEATURES_PATH = File.expand_path('../..', __FILE__) - -# load shared env with features -require File.expand_path('../../../../features/support/env', __FILE__) diff --git a/core/features/support/paths.rb b/core/features/support/paths.rb deleted file mode 100644 index 0e33ee1f5db..00000000000 --- a/core/features/support/paths.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'spree/url_helpers' -module NavigationHelpers - include Spree::UrlHelpers - - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # - def path_to(page_name) - case page_name - when /the home\s?page/ - spree.root_path - when /the admin home page/ - spree.admin_path - when /the sign in page/ - spree.new_user_session_path - when /the sign up page/ - spree.new_user_registration_path - when /an invalid taxon page/ - "/t/totally_bogus_taxon" - - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) - - else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - spree.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end - end - end -end - -World(NavigationHelpers) diff --git a/core/lib/generators/spree/dummy/dummy_generator.rb b/core/lib/generators/spree/dummy/dummy_generator.rb index cf215bb850d..3709e95cbc2 100644 --- a/core/lib/generators/spree/dummy/dummy_generator.rb +++ b/core/lib/generators/spree/dummy/dummy_generator.rb @@ -58,10 +58,6 @@ def test_dummy_clean end end - def cucumber_environment - template "cucumber/cucumber.rb", "#{dummy_path}/config/environments/cucumber.rb", :force => true - end - attr :lib_name attr :database diff --git a/core/lib/generators/spree/dummy/templates/cucumber/cucumber.rb b/core/lib/generators/spree/dummy/templates/cucumber/cucumber.rb deleted file mode 100644 index b18ef345e17..00000000000 --- a/core/lib/generators/spree/dummy/templates/cucumber/cucumber.rb +++ /dev/null @@ -1,38 +0,0 @@ -Dummy::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr - - config.action_mailer.default_url_options = { :host => 'testapp.com' } - -end diff --git a/core/spec/requests/admin/products/edit/images_spec.rb b/core/spec/requests/admin/products/edit/images_spec.rb index 05bb195ecb1..00e7fce889c 100644 --- a/core/spec/requests/admin/products/edit/images_spec.rb +++ b/core/spec/requests/admin/products/edit/images_spec.rb @@ -11,7 +11,7 @@ within('table.index tr:nth-child(2)') { click_link "Edit" } click_link "Images" click_link "new_image_link" - absolute_path = File.expand_path(Rails.root.join('..', '..', 'features', 'step_definitions', 'ror_ringer.jpeg')) + absolute_path = File.expand_path(Rails.root.join('..', '..', 'spec', 'support', 'ror_ringer.jpeg')) attach_file('image_attachment', absolute_path) click_button "Update" page.should have_content("successfully created!") diff --git a/core/spec/requests/admin/products/products_spec.rb b/core/spec/requests/admin/products/products_spec.rb index 82d1c3d2871..3eecf4cdea2 100644 --- a/core/spec/requests/admin/products/products_spec.rb +++ b/core/spec/requests/admin/products/products_spec.rb @@ -107,7 +107,7 @@ within('table#listing_products tr:nth-child(2)') { click_link "Edit" } click_link "Images" click_link "new_image_link" - absolute_path = File.expand_path(Rails.root.join('..', '..', 'features', 'step_definitions', 'ror_ringer.jpeg')) + absolute_path = File.expand_path(Rails.root.join('..', '..', 'spec', 'support', 'ror_ringer.jpeg')) attach_file('image_attachment', absolute_path) click_button "Update" page.should have_content("successfully created!") diff --git a/core/features/step_definitions/ror_ringer.jpeg b/core/spec/support/ror_ringer.jpeg similarity index 100% rename from core/features/step_definitions/ror_ringer.jpeg rename to core/spec/support/ror_ringer.jpeg diff --git a/dash/Rakefile b/dash/Rakefile index 62f2480118e..dd3016dd5d1 100644 --- a/dash/Rakefile +++ b/dash/Rakefile @@ -7,9 +7,8 @@ require 'cucumber/rake/task' require 'spree/core/testing_support/common_rake' RSpec::Core::RakeTask.new -Cucumber::Rake::Task.new -task :default => [:spec, :cucumber] +task :default => :spec spec = eval(File.read('spree_dash.gemspec')) diff --git a/promo/Rakefile b/promo/Rakefile index 7fe2d4e4d87..ee8bc613892 100644 --- a/promo/Rakefile +++ b/promo/Rakefile @@ -3,13 +3,11 @@ require 'rake/testtask' require 'rake/packagetask' require 'rubygems/package_task' require 'rspec/core/rake_task' -require 'cucumber/rake/task' require 'spree/core/testing_support/common_rake' RSpec::Core::RakeTask.new -Cucumber::Rake::Task.new -task :default => [:spec, :cucumber] +task :default => :spec spec = eval(File.read('spree_promo.gemspec')) diff --git a/promo/features/promotion_adjustments.feature b/promo/features/promotion_adjustments.feature deleted file mode 100644 index dfd0c374c42..00000000000 --- a/promo/features/promotion_adjustments.feature +++ /dev/null @@ -1,249 +0,0 @@ -Feature: Promotions which add adjustments to orders - - Background: - Given I have an admin account of "admin@person.com/password" - Given a payment method exists - Given a shipping method exists - - @selenium_with_chrome @wip - Scenario: Managing promotion action for creating line items - Given a product with name: "RoR Mug", price: "40" exists - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Order's total > $30" - And I fill in "Usage Limit" with "100" - And I press "Create" - Then I should see "Editing Promotion" - And I select "Create line items" from "Add action of type" - And I press "Add" within "#action_fields" - And I fill in "Name or SKU" with "RoR Mug" - # For this to work we need to simulate pressing tab to select the autocomplete item - And I fill in "Qty" with "2" - # Allow the variant select to populate - And I wait for 5 seconds - And I press "Add" within ".add-line-item" - - @selenium - Scenario: A coupon promotion with flat rate discount - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Order's total > $30" - And I fill in "Usage Limit" with "100" - And I select "Coupon code added" from "Event" - And I fill in "Code" with "ORDER_30" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Item total" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Order total meets these criteria" with "30" - And I press "Update" within "#rule_fields" - - And I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Rate (per order)" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Amount" with "5" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Mug", price: "40" to cart - And I follow "Checkout" - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - When I choose "UPS Ground" as shipping method and "Check" as payment method and set coupon code to "ORDER_30" - Then the existing order should have total at "47" - - @selenium - Scenario: A single use coupon promotion with flat rate discount - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Order's total > $30" - And I fill in "Usage Limit" with "20" - And I select "Coupon code added" from "Event" - And I fill in "Code" with "SINGLE_USE" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Item total" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Order total meets these criteria" with "30" - And I press "Update" within "#rule_fields" - - And I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Rate (per order)" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Amount" with "5" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I follow "Logout" - And I log in as "john@test.com/secret" - - And I add a product with name: "RoR Mug", price: "40" to cart - And I follow "Checkout" - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - When I choose "UPS Ground" as shipping method and "Check" as payment method and set coupon code to "SINGLE_USE" - Then the resulting order should have a total of "47" - - @selenium - Scenario: An automatic promotion with flat percent discount - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Order's total > $30" - And I fill in "Code" with "" - And I select "Order contents changed" from "Event" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Item total" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Order total meets these criteria" with "30" - And I press "Update" within "#rule_fields" - - And I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Percent" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Flat Percent" with "10" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Mug", price: "40" to cart - And I follow "Checkout" - Then the existing order should have total at "36" - When I add a product with name: "RoR Bag", price: "20" to cart - And I follow "Checkout" - Then the existing order should have total at "54" - - - @selenium - Scenario: An automatic promotion with free shipping - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Free Shipping" - And I fill in "Code" with "" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Item total" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Order total meets these criteria" with "30" - And I press "Update" within "#rule_fields" - - And I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Free Shipping" from "Calculator" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Bag", price: "20" to cart - And I follow "Checkout" - When I fill billing address with correct data - And check "order_use_billing" - And press "Save and Continue" - When I choose "UPS Ground" as shipping method - Then the existing order should have total at "31" - And I should not see "Free Shipping" - When I add a product with name: "RoR Book", price: "20" to cart - And I follow "Checkout" - Then I should see "Free Shipping" - And the existing order should have total at "42" - - @selenium - Scenario: An automatic promotion requiring a landing page to be visited - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Deal" - And I select "Order contents changed" from "Event" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Landing Page" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Path" with "cvv" - And I press "Update" within "#rule_fields" - - When I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Rate (per order)" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Amount" with "4" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Mug", price: "40" to cart - Then the existing order should have total at "40" - - When I go to "/cvv" - And I add a product with name: "RoR Mug", price: "40" to cart - Then the existing order should have total at "76" - - @selenium - Scenario: Ceasing to be eligible for a promotion with item total rule then becoming eligible again - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "Spend over $50 and save $5" - And I select "Order contents changed" from "Event" - And I press "Create" - Then I should see "Editing Promotion" - - When I select "Item total" from "Add rule of type" - And I press "Add" within "#rule_fields" - And I fill in "Order total meets these criteria" with "50" - And I press "Update" within "#rule_fields" - - And I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Rate (per order)" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Amount" with "5" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Mug", price: "20" to cart - Then the existing order should have total at "20" - - When I update the quantity on the first cart item to "2" - Then the existing order should have total at "40" - And the existing order should not have any promotion credits - - When I update the quantity on the first cart item to "3" - Then the existing order should have total at "55" - And the existing order should have 1 promotion credit - - When I update the quantity on the first cart item to "2" - Then the existing order should have total at "40" - And the existing order should have 1 promotion credit - - When I update the quantity on the first cart item to "3" - Then the existing order should have total at "55" - - @selenium - Scenario: Only counting the most valuable promotion adjustment in an order - - When I log in as an admin user and go to the new promotion form - And I fill in "Name" with "$5 off" - And I select "Order contents changed" from "Event" - And I press "Create" - Then I should see "Editing Promotion" - When I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Rate (per order)" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Amount" with "5" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I go to admin promotions page - When I follow "New Promotion" - And I fill in "Name" with "%10 off" - And I select "Order contents changed" from "Event" - And I press "Create" - Then I should see "Editing Promotion" - When I select "Create adjustment" from "Add action of type" - And I press "Add" within "#action_fields" - And I select "Flat Percent" from "Calculator" - And I press "Update" within "#actions_container" - And I fill in "Flat Percent" with "10" within ".calculator-fields" - And I press "Update" within "#actions_container" - - When I add a product with name: "RoR Mug", price: "20" to cart - Then the existing order should have total at "15" - And the existing order should have 2 promotion credits - - When I update the quantity on the first cart item to "2" - Then the existing order should have total at "35" - - When I update the quantity on the first cart item to "3" - Then the existing order should have total at "54" diff --git a/promo/features/step_definitions/promotions_steps.rb b/promo/features/step_definitions/promotions_steps.rb deleted file mode 100644 index 7e433a0efd0..00000000000 --- a/promo/features/step_definitions/promotions_steps.rb +++ /dev/null @@ -1,37 +0,0 @@ -When /^I log in as an admin user and go to the new promotion form$/ do - When('I go to the sign in page') - And('I sign in as "admin@person.com/password"') - And('I go to admin promotions page') - When('I follow "New Promotion"') -end - -Given /^I log in as "(.+)\/(.+)"$/ do |email, password| - Given("I am signed up as \"#{email}/#{password}\"") - When('I go to the sign in page') - And("I sign in as \"#{email}/#{password}\"") -end - -Then /^the resulting order should have a total of "([^"]*)"$/ do |total| - Spree::Order.last.total.to_f.should == total.to_f -end - -Then /^the existing order should have total at "([^"]*)"$/ do |total| - Spree::Order.first.total.to_f.should == total.to_f -end - -Then /^the existing order should not have any promotion credits$/ do - Spree::Order.first.adjustments.promotion.count.should == 0 -end - -Then /^the existing order should have (\d+) promotion credits?$/ do |count| - Spree::Order.first.adjustments.promotion.count.should == count.to_i -end - -When /^I update the quantity on the first cart item to "([^"]*)"$/ do |quantity| - When(%(I fill in "order[line_items_attributes][0][quantity]" with "#{quantity}")) - And('I press "Update"') -end - - - - diff --git a/promo/features/support/env.rb b/promo/features/support/env.rb deleted file mode 100644 index 4da673bf7ed..00000000000 --- a/promo/features/support/env.rb +++ /dev/null @@ -1,4 +0,0 @@ -FEATURES_PATH = File.expand_path('../..', __FILE__) - -# load shared env with features -require File.expand_path('../../../../features/support/env', __FILE__) diff --git a/promo/features/support/paths.rb b/promo/features/support/paths.rb deleted file mode 100644 index 0c8b3d4e529..00000000000 --- a/promo/features/support/paths.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'spree/url_helpers' - -module NavigationHelpers - include Spree::UrlHelpers - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # - def path_to(page_name) - case page_name - - when "admin promotions page" - spree.admin_promotions_path - when /the home\s?page/ - '/' - when /the sign in page/ - spree.new_user_session_path - when /the sign up page/ - spree.new_user_registration_path - - when /"\/cvv"/ - '/cvv' - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) - - else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - spree.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end - end - end -end - -World(NavigationHelpers)