Skip to content

Commit

Permalink
create product colors spec steps created
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrychekalin committed Apr 21, 2016
1 parent b6cbda8 commit 8a22ebc
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
22 changes: 22 additions & 0 deletions engines/admin_ui/spec/acceptance/product_colors.feature
@@ -0,0 +1,22 @@
Feature: Assign colors to products

Background:
Given A sample database with valid data
And The example admin is signed in

@javascript
Scenario:
When I am on the product colors page
And I click on "Create a Color" link
And I select "Connie" product from chosen select box
And I select "Coral" color from chosen select box
And I click on "Create" button
Then I should see "Color 'coral' for the product 'Connie' successfully created"

Scenario:
When I am on the product colors page
And I click on "Create a Color" link
And I select "Connie" product from chosen select box
And I click on "Create" button
Then I should see "can't be blank"

16 changes: 16 additions & 0 deletions engines/admin_ui/spec/support/steps/admin_steps.rb
@@ -0,0 +1,16 @@
module Acceptance
module AdminSteps
step 'The example admin is signed in' do
visit '/login'
fill_in('Email', with: 'admin@example.com')
fill_in('Password', with: '123456')
click_button 'Login'
visit '/fame_admin'
expect(page).to have_text('Welcome to #new Admin')
end
end
end

RSpec.configure do |config|
config.include Acceptance::AdminSteps, type: :feature
end
22 changes: 22 additions & 0 deletions engines/admin_ui/spec/support/steps/product_colors_steps.rb
@@ -0,0 +1,22 @@
module Acceptance
module ProductColorsSteps

step 'I am on the product colors page' do
visit '/fame_admin/product_colors'
end

step 'I select "Connie" product from chosen select box' do
chosen_select('Connie (SKU: 4B453)', from: '#product_color_value_product_id')
end

step 'I select "Coral" color from chosen select box' do
chosen_select('coral', from: '#product_color_value_option_value_id')
end

end
end

RSpec.configure do |config|
config.include Chosen::Rspec::FeatureHelpers, type: :feature
config.include Acceptance::ProductColorsSteps, type: :feature
end

0 comments on commit 8a22ebc

Please sign in to comment.