----------------------------------------------------------------------------------------------------------------------------
Given I have only a product named "Sushi de Pato" # features/
step_definitions/product_
steps.rb:19
unexpected invocation:
#<Mock:ProductCategory_1001>.__mock_proxy()
unsatisfied expectations:
- expected exactly once, not yet invoked:
#<Mock:ProductCategory_1001>.errors(any_pa
rameters)
- expected exactly once, not yet invoked:
#<Mock:ProductCategory_1001>.id(any_parame
ters)
- expected exactly once, not yet invoked:
#<Mock:ProductCategory_1001>.to_param(any_
parameters)
- expected exactly once, not yet invoked:
#<Mock:ProductCategory_1001>.new_record?(a
ny_parameters)
- expected exactly once, not yet invoked:
#<Mock:ProductCategory_1001>.destroyed?(an
y_parameters)
satisfied expectations:
- allowed any number of times, not yet invoked:
#<Mock:errors>.count(any_parameters)
(Mocha::ExpectationError)
----------------------------------------------------------------------------------------------------------------------------
I haven't yet implemented the ProductCategory class and I just want it
to return an ID and a 'name' attribute.
This is my step definition:
----------------------------------------------------------------------------------------------------------------------------
Given /^I have only a product named "([^\"]*)"$/ do |name|
@product = Product.create!(:name => name, :description =>
'Foo', :price => 100, :points => 100, :category =>
mock_model(ProductCategory))
end
----------------------------------------------------------------------------------------------------------------------------
And this is my env.rb file:
----------------------------------------------------------------------------------------------------------------------------
$: << File.join(File.dirname(__FILE__),"..")
require 'spec\spec_helper
----------------------------------------------------------------------------------------------------------------------------
I am using RSPec 1.3.0, cucumber 0.6.3 and webrat 0.7.0
I've tried to use stubs as well but got some other errors instead...
require "spec/mocks"
Before do
# To get RSpec stubs and mocks working.
$rspec_mocks ||= Spec::Mocks::Space.new
end
After do
begin
$rspec_mocks.verify_all
ensure
$rspec_mocks.reset_all
end
end
> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>
>