-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlist_invoices_test.rb
57 lines (45 loc) · 1.53 KB
/
list_invoices_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# frozen_string_literal: true
# Copyright (c) 2006-2017, Puzzle ITC GmbH. This file is part of
# PuzzleTime and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/puzzle/puzzletime.
require 'test_helper'
class ListInvoicesTest < ActionDispatch::IntegrationTest
test 'list invoices as employee has no create/edit/destroy links' do
timeout_safe do
list_invoices_as :pascal
assert has_no_link?('Erstellen')
assert has_no_link?('Bearbeiten')
assert has_no_link?('Löschen')
end
end
test 'list invoices as employee which is order responsible for another order has no create/edit/destroy links' do
timeout_safe do
list_invoices_as :lucien
assert has_no_link?('Erstellen')
assert has_no_link?('Bearbeiten')
assert has_no_link?('Löschen')
end
end
test 'list invoices as order responsible member has create/edit/destroy links' do
timeout_safe do
list_invoices_as :long_time_john
assert has_link?('Erstellen')
assert has_link?('Bearbeiten')
assert has_link?('Löschen')
end
end
test 'list invoices as management has create/edit/destroy links' do
timeout_safe do
list_invoices_as :mark
assert has_link?('Erstellen')
assert has_link?('Bearbeiten')
assert has_link?('Löschen')
end
end
private
def list_invoices_as(employee)
login_as employee
visit order_invoices_path(order_id: orders(:webauftritt).id)
end
end