comments_test.rb revision 40538f8b3af5a0f23baf731faf39f4abf6b78176
require 'integration_test_helper'
setup do
# 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