Files
mozo-backend/spec/acceptance_steps/suppliers/employees_steps.rb
T
2015-02-24 13:43:44 +01:00

24 lines
748 B
Ruby

step "there is an other employee" do
@other_employee = create :employee, :confirmed, name: 'Other employee'
@supplier.add_employee @other_employee
end
step "the supplier employee clicks on the other employee table edit button" do
find 'table.table'
all('tr').last.find('.table-edit').click
end
step "the supplier emloyee sets the :attribute to :value" do |attribute, value|
js_set_field ".form-row.#{attribute} input", value
end
step "the supplier emloyee clicks the active switch to deactivate the employee" do
js_click '.form-row.active .switch'
end
step "the other employee should no longer be active for the current supplier" do
sleep 1
@supplier.reload
@supplier.settings_for(@other_employee).active?.should be false
end