Spec employees
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user