Commit 7d360cd3b326fad8bce80c854119450e66a54d79

Authored by Rodrigo Souto
1 parent 8476dfd0

categories-block: fixing cucumber tests

Still not completely fixed
app/models/categories_block.rb
@@ -8,6 +8,8 @@ class CategoriesBlock < Block @@ -8,6 +8,8 @@ class CategoriesBlock < Block
8 8
9 settings_items :category_types, :type => Array, :default => [] 9 settings_items :category_types, :type => Array, :default => []
10 10
  11 + attr_accessible :category_types
  12 +
11 def self.description 13 def self.description
12 _("Categories Menu") 14 _("Categories Menu")
13 end 15 end
features/categories_block.feature
@@ -28,7 +28,8 @@ Feature: categories_block @@ -28,7 +28,8 @@ Feature: categories_block
28 28
29 @selenium 29 @selenium
30 Scenario: List just product categories 30 Scenario: List just product categories
31 - Given I follow "Edit" within ".categories-block" 31 + Given display ".button-bar"
  32 + And I follow "Edit" within ".categories-block"
32 And I check "Product" 33 And I check "Product"
33 When I press "Save" 34 When I press "Save"
34 Then I should see "Food" 35 Then I should see "Food"
@@ -39,7 +40,8 @@ Feature: categories_block @@ -39,7 +40,8 @@ Feature: categories_block
39 40
40 @selenium 41 @selenium
41 Scenario: Show submenu if it exists 42 Scenario: Show submenu if it exists
42 - Given I follow "Edit" within ".categories-block" 43 + Given display ".button-bar"
  44 + And I follow "Edit" within ".categories-block"
43 And I check "Product" 45 And I check "Product"
44 And I press "Save" 46 And I press "Save"
45 Then I should see "Food" 47 Then I should see "Food"
@@ -56,7 +58,8 @@ Feature: categories_block @@ -56,7 +58,8 @@ Feature: categories_block
56 58
57 @selenium 59 @selenium
58 Scenario: Show only one submenu per time 60 Scenario: Show only one submenu per time
59 - Given I follow "Edit" within ".categories-block" 61 + Given display ".button-bar"
  62 + And I follow "Edit" within ".categories-block"
60 And I check "Product" 63 And I check "Product"
61 And I press "Save" 64 And I press "Save"
62 Then I should see "Book" 65 Then I should see "Book"
@@ -66,14 +69,16 @@ Feature: categories_block @@ -66,14 +69,16 @@ Feature: categories_block
66 69
67 @selenium 70 @selenium
68 Scenario: List just general categories 71 Scenario: List just general categories
69 - Given I follow "Edit" within ".categories-block" 72 + Given display ".button-bar"
  73 + And I follow "Edit" within ".categories-block"
70 And I check "Generic category" 74 And I check "Generic category"
71 When I press "Save" 75 When I press "Save"
72 Then I should see "Wood" 76 Then I should see "Wood"
73 77
74 @selenium 78 @selenium
75 Scenario: List just regions 79 Scenario: List just regions
76 - Given I follow "Edit" within ".categories-block" 80 + Given display ".button-bar"
  81 + And I follow "Edit" within ".categories-block"
77 And I check "Region" 82 And I check "Region"
78 When I press "Save" 83 When I press "Save"
79 Then I should see "Bahia" 84 Then I should see "Bahia"