Commit ab476aee7482060826c3772b766034001598b8fe

Authored by Daniel Cunha
1 parent e76a3624

http_caching.feature

features/http_caching.feature
... ... @@ -35,13 +35,13 @@ Feature: HTTP caching
35 35 Then the response should be valid for 90 minutes
36 36  
37 37 Scenario: profile pages, default configuaration
38   - When I go to João Silva's homepage
  38 + When I go to joao's homepage
39 39 Then the response should be valid for 15 minutes
40 40  
41 41 Scenario: profile pages, custom configuration
42 42 Given the following environment configuration
43 43 | profile_cache_in_minutes | 90 |
44   - When I go to João Silva's homepage
  44 + When I go to joao's homepage
45 45 Then the response should be valid for 90 minutes
46 46  
47 47 Scenario: account controller should not be cached at all
... ... @@ -50,7 +50,7 @@ Feature: HTTP caching
50 50  
51 51 Scenario: profile administration
52 52 Given I am logged in as "joao"
53   - When I go to João Silva's control panel
  53 + When I go to joao's control panel
54 54 Then there must be no cache at all
55 55  
56 56 Scenario: environment administration
... ...
features/step_definitions/http_caching_steps.rb
1 1 Then /^the response should be valid for (.+) minutes$/ do |n|
2   - response.headers['Cache-Control'].split(/,\s*/).should include("max-age=#{n.to_i * 60}")
  2 + page.response_headers['Cache-Control'].split(/,\s*/).should include("max-age=#{n.to_i * 60}")
3 3 end
4 4  
5 5 Then /^the cache should be public/ do
6   - response.headers['Cache-Control'].split(/,\s*/).should include("public")
  6 + page.response_headers['Cache-Control'].split(/,\s*/).should include("public")
7 7 end
8 8  
9 9 Then /^there must be no cache at all$/ do
10   - parts = response.headers['Cache-Control'].split(/,\s*/)
  10 + parts = page.response_headers['Cache-Control'].split(/,\s*/)
11 11 parts.should include('must-revalidate')
12 12 parts.should include('max-age=0')
13 13 end
... ...