On Thursday 11 August 2011 13:47:48 Tomas Hrcka wrote:
---
src/app/views/pools/_form.haml | 2 +-
src/features/pool.feature | 6 +++---
src/features/step_definitions/instance_steps.rb | 2 +-
src/features/step_definitions/pool_steps.rb | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/app/views/pools/_form.haml
b/src/app/views/pools/_form.haml index af88cab..50e91fa 100644
--- a/src/app/views/pools/_form.haml
+++ b/src/app/views/pools/_form.haml
@@ -1,4 +1,4 @@
-- form_for @pool, :html => {:class => 'generic'} do |form|
+= form_for @pool, :html => {:class => 'generic'} do |form|
= error_messages_for @pool
%fieldset
diff --git a/src/features/pool.feature b/src/features/pool.feature
index 79021d8..9c30bb5 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -17,7 +17,7 @@ Feature: Manage Pools
And I select "default" from "pool_pool_family_id"
And I fill in "quota_instances" with "unlimited"
And I press "save_button"
- Then I should be on the pool page
+ Then I should be on the page for the pool "mockpool"
And I should see "mockpool Pool"
And I should have a pool named "mockpool"
@@ -76,7 +76,7 @@ Feature: Manage Pools
When I fill in "pool_name" with "mockpool"
And I select "default" from "pool_pool_family_id"
And I press "save_button"
- Then I should be on the pool page
+ Then I should be on the page for the pool "mockpool"
And I should see "Pool added"
And I should see "mockpool"
And I should have a pool named "mockpool"
@@ -88,7 +88,7 @@ Feature: Manage Pools
When I fill in "pool_name" with "foopool"
And I select "default" from "pool_pool_family_id"
And I press "save_button"
- Then I should be on the pool page
+ Then I should be on the page for the pool "foopool"
And I should see "Pool added"
And I should have a pool named "mockpool"
And I should have a pool named "foopool"
diff --git a/src/features/step_definitions/instance_steps.rb
b/src/features/step_definitions/instance_steps.rb index 795b7d3..82d81a1
100644
--- a/src/features/step_definitions/instance_steps.rb
+++ b/src/features/step_definitions/instance_steps.rb
@@ -37,7 +37,7 @@ When /^I manually go to the key action for this
instance$/ do end
Given /^I see "([^"]*)"$/ do |text|
- page.should contain(text)
+ page.should have_content(text)
end
Then /^I should see the Save dialog for a (.+) file$/ do |filetype|
diff --git a/src/features/step_definitions/pool_steps.rb
b/src/features/step_definitions/pool_steps.rb index 232ca9d..759b1f8
100644
--- a/src/features/step_definitions/pool_steps.rb
+++ b/src/features/step_definitions/pool_steps.rb
@@ -91,16 +91,16 @@ end
When /^I create a pool$/ do
pool = Factory.build :pool
pool.pool_family.save!
- visit pools_url, :post, 'pool[name]' => pool.name,
'pool[pool_family_id]' => pool.pool_family.id + post
pools_url('pool[name]' => pool.name, 'pool[pool_family_id]' =>
pool.pool_family.id) end
Then /^I should get back a pool in JSON format$/ do
- data = ActiveSupport::JSON.decode(page.body)
+ data = ActiveSupport::JSON.decode(page.source)
data['pool'].should_not be_nil
end
When /^I delete "([^"]*)" pool$/ do |arg1|
- visit(multi_destroy_pools_url, :post, 'pools_selected[]' =>
Pool.find_by_name(arg1).id) + visit
multi_destroy_pools_url('pools_selected[]' => Pool.find_by_name(arg1).id)
end
Given /^there are (\d+) pools$/ do |arg1|
NACK.
JSON cuke tests are failing. Use page.source instead of page.body in all JSON
steps and it will work. Still need to look at scenarion 'delete a pool' and
'Create a pool and get JSON response', I did a quick look on them and it seems
that content-type of response is HTML instead of JSON.
--
Jozef Zigmund