Better section actions speccing
This commit is contained in:
@@ -46,3 +46,30 @@ Feature: Supplier section view
|
||||
When I reset the section selector in the supplier dashboard
|
||||
Then I should see the list and the new list
|
||||
And I should see the order and the new order
|
||||
|
||||
|
||||
@javascript
|
||||
Scenario: Going to edit mode and change section properties
|
||||
Given there is an active list and order
|
||||
And there are 2 supplier sections
|
||||
And the last supplier section has a table with known coordinates
|
||||
And I am signed in as supplier
|
||||
When I visit the supplier last section path
|
||||
And I click the supplier section edit mode button
|
||||
And I fill in the supplier edit section form with new values
|
||||
Then the last section tab header should have the newly filled in name
|
||||
When I click the supplier section normal mode button
|
||||
Then the supplier last section properties should be updated to the new values
|
||||
|
||||
# capybara-webkit 1.1.0 drag to is not yet supported it seems
|
||||
@javascript @broken
|
||||
Scenario: Dragging a table to another section
|
||||
Given there is an active list and order
|
||||
And there are 2 supplier sections
|
||||
And the last supplier section has a table with known coordinates
|
||||
And I am signed in as supplier
|
||||
When I visit the supplier last section path
|
||||
And I click the supplier section edit mode button
|
||||
And I drag the table from the last section to the first section tab header
|
||||
And I wait 1 second
|
||||
Then the supplier table should have been linked to the first section
|
||||
|
||||
@@ -10,6 +10,9 @@ step "I visit the supplier section path" do
|
||||
visit "/supplier/sections/#{@section.id}"
|
||||
end
|
||||
|
||||
step "I visit the supplier last section path" do
|
||||
visit "/supplier/sections/#{@sections.last.id}"
|
||||
end
|
||||
|
||||
step "I should be redirected to the supplier settings page" do
|
||||
#page.current_path.should == supplier_settings_path
|
||||
|
||||
@@ -70,3 +70,45 @@ step "I should be redirected to the supplier section view" do
|
||||
#page.current_path.should == "/supplier/sections/#{@section.id}"
|
||||
page.evaluate_script('window.location.pathname').should == "/supplier/sections/#{@section.id}"
|
||||
end
|
||||
|
||||
step "the last supplier section has a table with known coordinates" do
|
||||
@table = create :table, position_x: 4, position_y: 5, number: 74, supplier: @supplier, section: @sections.last
|
||||
end
|
||||
|
||||
step "I click the supplier section edit mode button" do
|
||||
find('.section-edit-mode-button').click
|
||||
end
|
||||
|
||||
step "I click the supplier section normal mode button" do
|
||||
find('.section-normal-mode-button').click
|
||||
end
|
||||
|
||||
step "I fill in the supplier edit section form with new values" do
|
||||
find('.section-edit-title-field').set 'RenamedSection'
|
||||
find('.section-edit-width-field').set '40'
|
||||
find('.section-edit-height-field').set '52.7'
|
||||
end
|
||||
|
||||
step "the last section tab header should have the newly filled in name" do
|
||||
find(".section-tab-header-#{@sections.last.id}").text.should == 'RenamedSection'
|
||||
end
|
||||
|
||||
step "the supplier last section properties should be updated to the new values" do
|
||||
sleep 1
|
||||
section = @sections.last
|
||||
section.reload
|
||||
section.title.should == 'RenamedSection'
|
||||
section.width.should == 40.0
|
||||
section.height.should == 52.7
|
||||
end
|
||||
|
||||
step "I drag the table from the last section to the first section tab header" do
|
||||
first_section_tab_header = find(".section-tab-header-#{@sections.first.id}")
|
||||
table_view = find(".section-table-#{@table.id}")
|
||||
table_view.drag_to first_section_tab_header
|
||||
end
|
||||
|
||||
step "the supplier table should have been linked to the first section" do
|
||||
@table.reload
|
||||
@table.section_id.should == @sections.first.id
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ Dir.glob("spec/acceptance_steps/**/*steps.rb") { |f| load f, true }
|
||||
I18n.locale =I18n.default_locale
|
||||
Devise.stretches = 1
|
||||
Capybara.javascript_driver = :webkit
|
||||
Capybara.default_wait_time = 4 # ember needs more time than the default of 2
|
||||
#Capybara.javascript_driver = :selenium
|
||||
|
||||
module FactoryAttributesFor
|
||||
|
||||
Reference in New Issue
Block a user