Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create product colors spec steps created
- Loading branch information
1 parent
b6cbda8
commit 8a22ebc
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
22
engines/admin_ui/spec/support/steps/product_colors_steps.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |