Spec employees

This commit is contained in:
2015-02-24 13:43:44 +01:00
parent 755690131c
commit 16418dde30
18 changed files with 104 additions and 97 deletions
@@ -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
@@ -0,0 +1,7 @@
step "the supplier employee clicks on :selector" do |selector|
js_click selector
end
step "the supplier employee clicks the confirm modal button" do
js_click '.modal-confirm'
end
@@ -32,3 +32,7 @@ end
step "the supplier should be redirected to the root path" do
ember_route_should_be '/'
end
step "the supplier employee visits the :path_spec path" do |path_spec|
visit "/supplier#/#{path_spec}"
end