X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/124ec2e9d560e0df291e5a8e5aa67ef5db2f5d46..8a4405dd0c3af7783d0cc9a4f864f4ee5cd0e71d:/test/helpers/application_helper_test.rb diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 720113e65..89e5a3893 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1,6 +1,8 @@ require "test_helper" class ApplicationHelperTest < ActionView::TestCase + attr_accessor :current_user + def setup I18n.locale = "en" end @@ -37,114 +39,12 @@ class ApplicationHelperTest < ActionView::TestCase def test_rss_link_to link = rss_link_to(:controller => :diary_entry, :action => :rss) - assert_dom_equal "", link + assert_dom_equal "", link end def test_atom_link_to link = atom_link_to(:controller => :changeset, :action => :feed) - assert_dom_equal "", link - end - - def test_style_rules - @user = nil - - css = style_rules - assert_match /\.hidden /, css - assert_match /\.hide_unless_logged_in /, css - assert_no_match /\.hide_if_logged_in /, css - assert_no_match /\.hide_if_user_/, css - assert_no_match /\.show_if_user_/, css - assert_match /\.hide_unless_administrator /, css - assert_match /\.hide_unless_moderator /, css - - @user = create(:user) - - css = style_rules - assert_match /\.hidden /, css - assert_no_match /\.hide_unless_logged_in /, css - assert_match /\.hide_if_logged_in /, css - assert_match /\.hide_if_user_#{@user.id} /, css - assert_match /\.show_if_user_#{@user.id} /, css - assert_match /\.hide_unless_administrator /, css - assert_match /\.hide_unless_moderator /, css - - @user = create(:moderator_user) - - css = style_rules - assert_match /\.hidden /, css - assert_no_match /\.hide_unless_logged_in /, css - assert_match /\.hide_if_logged_in /, css - assert_match /\.hide_if_user_#{@user.id} /, css - assert_match /\.show_if_user_#{@user.id} /, css - assert_match /\.hide_unless_administrator /, css - assert_no_match /\.hide_unless_moderator /, css - - @user = create(:administrator_user) - - css = style_rules - assert_match /\.hidden /, css - assert_no_match /\.hide_unless_logged_in /, css - assert_match /\.hide_if_logged_in /, css - assert_match /\.hide_if_user_#{@user.id} /, css - assert_match /\.show_if_user_#{@user.id} /, css - assert_no_match /\.hide_unless_administrator /, css - assert_match /\.hide_unless_moderator /, css - end - - def test_if_logged_in - html = if_logged_in { "Test 1" } - assert_dom_equal "