Better section actions speccing

This commit is contained in:
2013-12-22 20:25:35 +01:00
parent 592aa65054
commit 101cbd62e5
6 changed files with 81 additions and 5 deletions
@@ -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