3 class UserChangesetCommentsTest < ActionDispatch::IntegrationTest
4 # Test 'log in to comment' message for nonlogged in user
5 def test_log_in_message
6 changeset = create(:changeset, :closed)
8 get "/changeset/#{changeset.id}"
9 assert_response :success
11 assert_select "div#content" do
12 assert_select "div#sidebar" do
13 assert_select "div#sidebar_content" do
14 assert_select "div.browse-section" do
15 assert_select "div.notice.hide_if_logged_in"
22 # Test if the form is shown
23 def test_displaying_form
25 changeset = create(:changeset, :closed)
29 # We should now be at the login page
30 assert_response :success
31 assert_template "user/login"
33 post "/login", :params => { "username" => user.email, "password" => "test" }
34 assert_response :redirect
36 get "/changeset/#{changeset.id}"
38 assert_response :success
39 assert_template "browse/changeset"
41 assert_select "div#content" do
42 assert_select "div#sidebar" do
43 assert_select "div#sidebar_content" do
44 assert_select "div.browse-section" do
45 assert_select "form[action='#']" do
46 assert_select "textarea[name=text]"