1 require "application_system_test_case"
3 class NoteCommentsTest < ApplicationSystemTestCase
4 test "open note has login notice" do
5 note = create(:note_with_comments)
8 assert_no_button "Resolve"
9 assert_no_button "Comment"
10 assert_link "Log in to comment on this note", :href => login_path(:referer => note_path(note))
13 test "closed note has no login notice" do
14 note = create(:note_with_comments, :status => "closed", :closed_at => Time.now.utc)
17 assert_no_button "Reactivate"
18 assert_no_link "Log in to comment on this note"
22 note = create(:note_with_comments)
23 sign_in_as(create(:user))
26 assert_button "Resolve"
27 assert_button "Comment", :disabled => true
29 fill_in "text", :with => "Some text"
31 assert_button "Comment & Resolve"
32 assert_button "Comment"