diff --git a/features/session_and_cookies_handling.feature b/features/session_and_cookies_handling.feature deleted file mode 100644 index def24bb..0000000 --- a/features/session_and_cookies_handling.feature +++ /dev/null @@ -1,40 +0,0 @@ -Feature: session and cookies handling - - As a Noosfero system administrator - I want Noosfero to manage well it usage of sessions and cookies - So that we can use HTTP caching effectively - - @fixme - Scenario: home page, logged in - Given the following users - | login | - | joaosilva | - When I am logged in as "joaosilva" - And I go to the homepage - Then there must be a cookie "_noosfero_session" - - Scenario: home page, not logged in - When I go to the homepage - Then there must be no cookies - - @fixme - Scenario: user_data, not logged in - When I make a AJAX request to the user data path - Then there must be no cookies - - @fixme - Scenario: user_data, logged in - Given I am logged in as admin - When I make a AJAX request to the user data path - Then there must be a cookie "_noosfero_session" - - # FIXME for some reason I could not test this scenario, although manual tests - # indicate this works! - # Scenario: logout - # Given the following users - # | login | - # | joao | - # When I am logged in as "joao" - # And I log off - # And I go to the homepage - # Then there must be no cookies diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index 1d103ac..37ee20d 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -692,11 +692,6 @@ Given /^the cache is turned (on|off)$/ do |state| ActionController::Base.perform_caching = (state == 'on') end -When /^I make a AJAX request to (.*)$/ do |page| - header 'X-Requested-With', 'XMLHttpRequest' - visit(path_to(page)) -end - Given /^the environment is configured to (.*) after login$/ do |option| redirection = case option when 'stay on the same page' diff --git a/test/integration/http_caching_test.rb b/test/integration/http_caching_test.rb index c4cc94a..0f1980c 100644 --- a/test/integration/http_caching_test.rb +++ b/test/integration/http_caching_test.rb @@ -9,6 +9,7 @@ class HttpCachingTest < ActionController::IntegrationTest test 'home page, default configuration' do get '/' assert_cache(5.minutes) + assert_no_cookies end test 'home page, custom config' do @@ -91,6 +92,11 @@ class HttpCachingTest < ActionController::IntegrationTest assert_no_cache end + test 'user data, not logged in' do + get '/account/user_data', {}, { 'X-Requested-With' => 'XMLHttpRequest'} + assert_no_cookies + end + protected def set_env_config(data) -- libgit2 0.21.2