comments_test.rb revision a5015ca9daa067f062e9e373c3dfafd5631560d9
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require 'integration_test_helper'
setup do
@ontology.state = 'done'
# Add user as owner to the ontology
end
test 'create a comment' do
comment_text = 'very loooooooong comment'
find_link "Log out"
# zero comments at the beginning
within '#new_comment' do
# fill in the autocomplete input
click_button 'Create Comment'
end
# is the text too short?
within '#new_comment' do
# fill in the autocomplete input
click_button 'Create Comment'
end
# wait for the comment to be inserted
# success message
# author and timestamp
assert_match /#{@user.to_s} wrote a few seconds ago/, comment_li.text
# comment text
end
test 'delete a comment' do
# does one comment exist?
within '.comments' do
# delete the comment
click_link 'delete'
end
# is the comment deleted?
end
end