diff --git a/test/integration/enable_disable_features_test.rb b/test/integration/enable_disable_features_test.rb new file mode 100644 index 0000000..2403c14 --- /dev/null +++ b/test/integration/enable_disable_features_test.rb @@ -0,0 +1,20 @@ +require "#{File.dirname(__FILE__)}/../test_helper" + +class EnableDisableFeaturesTest < ActionController::IntegrationTest + fixtures :virtual_communities, :users + + def test_enable_features + uses_host 'anhetegua.net' + login('quentin', 'test') + get '/admin/features' + assert_response :success + assert_tag :tag => 'input', :attributes => { :name => 'features[feature1]' } + assert_tag :tag => 'input', :attributes => { :name => 'features[feature2]' } + assert_tag :tag => 'input', :attributes => { :name => 'features[feature3]' } + post 'admin/features/update' + assert_response :redirect + follow_redirect! + assert_response :success + assert_equal '/admin/features', path + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index f3d358e..4c4017f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -26,6 +26,8 @@ class Test::Unit::TestCase # Add more helper methods to be used by all tests here... + include AuthenticatedTestHelper + private def uses_host(name) @@ -33,3 +35,12 @@ class Test::Unit::TestCase end end + +class ActionController::IntegrationTest + def login(username, password) + post '/account/login', :login => username, :password => password + assert_response :redirect + follow_redirect! + assert_equal '/account', path + end +end -- libgit2 0.21.2