Hey rspec-users I just wanted to share this opportunity with you, I've been
making 200-300 dollars a day and I started only a week ago. Check out this news
article and it will show you how to get started, it's definitely easy enough
for you :)! http://g.msn.com.br/BR9/1369.0?http://news7cnbc.com
> On 2011-05-31 1:57 PM, Chris Habgood wrote:
>
>> The program works when I run it on the server.
>>
>> describe FoodsController do
>> render_views
>>
>> before(:each) do
>> Food.delete_all
>> login_as_admin
>> Food.stubs(:find).with("1").returns(@food = mock_model(Food,
>> :save=>fa
On 2011-05-31 1:57 PM, Chris Habgood wrote:
The program works when I run it on the server.
describe FoodsController do
render_views
before(:each) do
Food.delete_all
login_as_admin
Food.stubs(:find).with("1").returns(@food = mock_model(Food,
:save=>false))
end
#des
Can you give me the whole test code, with no comments? Just the stuff you
are running.
Thanks
Ken
On Tue, May 31, 2011 at 4:59 PM, Chris Habgood wrote:
> yes
>
>
> On Tue, May 31, 2011 at 15:33, Ken Egervari wrote:
>
>> Dumb question, do you have required "spec_helper" at the top of the file?
yes
On Tue, May 31, 2011 at 15:33, Ken Egervari wrote:
> Dumb question, do you have required "spec_helper" at the top of the file?
>
> Ken
>
>
>
> On Tue, May 31, 2011 at 4:03 PM, Chris Habgood wrote:
>
>> Ya, that is not working. The code I gave you I was trying different
>> things out.
>> Ra
Dumb question, do you have required "spec_helper" at the top of the file?
Ken
On Tue, May 31, 2011 at 4:03 PM, Chris Habgood wrote:
> Ya, that is not working. The code I gave you I was trying different things
> out.
> Rails 3.0
> Rspec rspec (2.6.0.rc6)
>
> On Tue, May 31, 2011 at 14:35, Ken
Ya, that is not working. The code I gave you I was trying different things
out.
Rails 3.0
Rspec rspec (2.6.0.rc6)
On Tue, May 31, 2011 at 14:35, Ken Egervari wrote:
> Oh, don't forget the :id in the call to edit
>
>
> before(:each) do
> @food = Food.new
> @food.id = 1
> end
>
> d
Oh, don't forget the :id in the call to edit
before(:each) do
@food = Food.new
@food.id = 1
end
describe "GET 'edit'" do
it "should be successful" do
Food.stub(:find).with("1").and_return(@food)
get :edit, :id => "1"
assigns(:food).should == @food
end
e
On Tue, May 31, 2011 at 2:57 PM, Chris Habgood wrote:
> The program works when I run it on the server.
>
> describe FoodsController do
> render_views
>
>before(:each) do
> Food.delete_all
> login_as_admin
> Food.stubs(:find).with("1").returns(@food = mock_model(Food,
> :save=
The program works when I run it on the server.
describe FoodsController do
render_views
before(:each) do
Food.delete_all
login_as_admin
Food.stubs(:find).with("1").returns(@food = mock_model(Food,
:save=>false))
end
#describe "stub_model(Food) with a hash of stubs" do
Full Error:
Failures:
1) FoodsController should assign the requested food to @food
Failure/Error: get :edit, :id => @food.id
ActionView::Template::Error:
undefined method `model_name' for NilClass:Class
# ./app/views/foods/_form.html.erb:1:in
`_app_views_foods__form_html_e
Hi Ken,
On 31 May 2011, at 19:09, Ken Egervari wrote:
> I have a module that extends ActiveSupport::Concern. Here is the `included`
> block:
>
> included do
> after_save :save_tags
>
> has_many :taggings, :as => :taggable
> has_many :tags, :through => :taggings
> end
>
> How c
On Tue, May 31, 2011 at 2:38 PM, Chris Habgood wrote:
> Still getting the same error. ugggh.
Truly, you have to give us some more code to help you.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-use
Still getting the same error. ugggh.
On Sat, May 28, 2011 at 10:50, Ken Egervari wrote:
> You also want to make sure that @food has an id of some kind, or Rails
> complains. For the 'new' action, you want to set @food.id to nil to make
> sure the form works for the new action.
>
> You might not
I have a module that extends ActiveSupport::Concern. Here is the `included`
block:
included do
after_save :save_tags
has_many :taggings, :as => :taggable
has_many :tags, :through => :taggings
end
How can I stub out these calls? I have tried a few ways, but Ruby complains
that the
15 matches
Mail list logo