Commit 1a13685cc1d3d01b112859a5c6ef3fe75a1f5365

Authored by Braulio Bhavamitra
1 parent 414bafe6

categories_block: Elements are not clickable on blocks edition

So use the block at the environment page
features/categories_block.feature
@@ -44,6 +44,7 @@ Feature: categories_block @@ -44,6 +44,7 @@ Feature: categories_block
44 And I follow "Edit" within ".block-outer .categories-block" 44 And I follow "Edit" within ".block-outer .categories-block"
45 And I check "Product" 45 And I check "Product"
46 And I press "Save" 46 And I press "Save"
  47 + And I go to /
47 Then I should see "Food" 48 Then I should see "Food"
48 And I should see "Book" 49 And I should see "Book"
49 And "Vegetarian" should not be visible within "span#category-name" 50 And "Vegetarian" should not be visible within "span#category-name"
@@ -62,6 +63,7 @@ Feature: categories_block @@ -62,6 +63,7 @@ Feature: categories_block
62 And I follow "Edit" within ".block-outer .categories-block" 63 And I follow "Edit" within ".block-outer .categories-block"
63 And I check "Product" 64 And I check "Product"
64 And I press "Save" 65 And I press "Save"
  66 + And I go to /
65 Then I should see "Book" 67 Then I should see "Book"
66 And "Literature" should not be visible within "span#category-name" 68 And "Literature" should not be visible within "span#category-name"
67 When I follow "block_2_category_2" 69 When I follow "block_2_category_2"
features/step_definitions/web_steps.rb
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 7
8 require 'uri' 8 require 'uri'
9 require 'cgi' 9 require 'cgi'
10 -require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) 10 +require_relative '../support/paths'
11 11
12 module WithinHelpers 12 module WithinHelpers
13 def with_scope(locator) 13 def with_scope(locator)
features/support/env.rb
@@ -65,5 +65,13 @@ Before do @@ -65,5 +65,13 @@ Before do
65 fixtures_folder = Rails.root.join('test', 'fixtures') 65 fixtures_folder = Rails.root.join('test', 'fixtures')
66 fixtures = ['environments', 'roles'] 66 fixtures = ['environments', 'roles']
67 ActiveRecord::Fixtures.create_fixtures(fixtures_folder, fixtures) 67 ActiveRecord::Fixtures.create_fixtures(fixtures_folder, fixtures)
  68 +
  69 + # The same browser session is used across tests, so expire caching
  70 + # can create changes from scenario to another.
  71 + e=Environment.default
  72 + e.home_cache_in_minutes = 0
  73 + e.general_cache_in_minutes = 0
  74 + e.profile_cache_in_minutes = 0
  75 + e.save
68 end 76 end
69 77