1 require "application_system_test_case"
3 class ChangesetCommentsTest < ApplicationSystemTestCase
4 test "open changeset has a still open notice" do
5 changeset = create(:changeset)
6 sign_in_as(create(:user))
7 visit changeset_path(changeset)
10 assert_no_button "Comment"
11 assert_text "Changeset still open"
15 test "changeset has a login notice" do
16 changeset = create(:changeset, :closed)
17 visit changeset_path(changeset)
20 assert_no_button "Subscribe"
21 assert_no_button "Comment"
22 assert_link "Log in to join the discussion", :href => login_path(:referer => changeset_path(changeset))
26 test "can add a comment to a changeset" do
27 changeset = create(:changeset, :closed)
30 visit changeset_path(changeset)
33 assert_no_content "Comment from #{user.display_name}"
34 assert_no_content "Some newly added changeset comment"
35 assert_button "Comment", :disabled => true
37 fill_in "text", :with => "Some newly added changeset comment"
39 assert_button "Comment", :disabled => false
43 assert_content "Comment from #{user.display_name}"
44 assert_content "Some newly added changeset comment"