Hello,
I retried with the version 2.14. I have this spec :
require 'spec_helper'
describe OrdersController do
#...
describe "POST 'create'" do
subject(:do_post!) { post 'create', params }
context "when the order and the credit card and the payment are
valid" do
before do
I have the same problem with many other. Thanks for your help.
Le 2013-06-11 17:02, Andy Lindeman a écrit :
On Mon, Jun 10, 2013 at 9:16 PM, Guirec Corbel wrote:
I am using rspec-rails 2.14.0.rc1
Can you give this a try with the latest 2.14 from rspec-core git? We
fixed an issue with `let` d
On Mon, Jun 10, 2013 at 9:16 PM, Guirec Corbel wrote:
> I am using rspec-rails 2.14.0.rc1
Can you give this a try with the latest 2.14 from rspec-core git? We
fixed an issue with `let` definitions that I think might be related.
That is, add this to Gemfile and run `bundle update rspec-core`:
ge
I am using rspec-rails 2.14.0.rc1
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On Mon, Jun 10, 2013 at 6:45 PM, Guirec Corbel wrote:
> Hi,
>
> I a controller spec like this :
> https://gist.github.com/GCorbel/5753042#file-painting_controller_spec_1-rb.
> (at the top). When I try to run this spec I have this message :
>
> Failure/Error: before { painting.stub(:valid?).an
Hi,
I a controller spec like this :
https://gist.github.com/GCorbel/5753042#file-painting_controller_spec_1-rb.
(at the top). When I try to run this spec I have this message :
Failure/Error: before { painting.stub(:valid?).and_return(true) }
NameError:
undefined local variable or method ` pai
Thanks again David :) Pure magic to me, I don't really understand how/
why that makes it work. But it does!
On Jun 14, 2:30 am, David Chelimsky wrote:
> On Jun 13, 2010, at 5:32 PM, Kristian Mandrup
> wrote:
>
>
>
> > shared_examples_for "a template that renders the messages/form
> > partial"
On Jun 13, 2010, at 5:32 PM, Kristian Mandrup
wrote:
shared_examples_for "a template that renders the messages/form
partial" do
it "renders the messages/form partial" do
view.should_receive(:_render_partial).
with(hash_including(:partial => "form"))
render
end
end
# new.html.erb
shared_examples_for "a template that renders the messages/form
partial" do
it "renders the messages/form partial" do
view.should_receive(:_render_partial).
with(hash_including(:partial => "form"))
render
end
end
# new.html.erb
<%= render "sidebar", :recent_messages => @recent_me
Thanks! Just what I needed :)
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On Jun 13, 2010, at 4:35 PM, Kristian Mandrup wrote:
> Hi David,
>
> Sounds great! Looking forward to more documentation :)
> I have now gone through all the examples in the RSpec book and got
> them working with the latest version of RSpec 2 and Rails 3 beta4.
> I only have one loose end:
>
> s
Hi David,
Sounds great! Looking forward to more documentation :)
I have now gone through all the examples in the RSpec book and got
them working with the latest version of RSpec 2 and Rails 3 beta4.
I only have one loose end:
shared_examples_for "a template that renders the messages/form
partial"
On Jun 13, 2010, at 6:49 AM, Kristian Mandrup wrote:
> assigns(:message).should eq(@message)
>
> assign(:message, stub("Message", :text => "Hello world!"))
>
> Hmm, so 'assign' to assign a variable and 'assigns' to read an
> assigned variable?
> We need to update the RSpec 2 wiki or somewhere wi
assigns(:message).should eq(@message)
assign(:message, stub("Message", :text => "Hello world!"))
Hmm, so 'assign' to assign a variable and 'assigns' to read an
assigned variable?
We need to update the RSpec 2 wiki or somewhere with all these API
changes so it is clear to everyone.
On Jun 11, 9:
On Thu, Jun 10, 2010 at 4:41 PM, wrote:
> I might be missing something basic here, but I'm stumped on this
> error:
>
> model code:
>
> class CachedStat < ActiveRecord::Base
> def self.create_stats_days_ago(days_ago, human_id)
> d = Date.today - days_ago.day
> �...@prs = PageRequest.find(:
Thanks a lot, that fixed it. Sorry about the double post, btw.
On Sep 2, 3:03 pm, theLemcke wrote:
> I ran this install
> guide:http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-ra...
>
> Then generated a rails app, and ran 'script/generate rspec' and
> 'script/generate rspec_m
I ran this install guide:
http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition
Then generated a rails app, and ran 'script/generate rspec' and
'script/generate rspec_model Note'
When I try to spec note_spec.rb I get this error:
/Users/sixt
On Wed, Sep 2, 2009 at 5:22 PM, theLemcke wrote:
> So I began with this setup:
> http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition
>
> Created a basic rails setup, ran 'script/generate rspec' and 'script/
> generate rspec_model Note' and t
So I began with this setup:
http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition
Created a basic rails setup, ran 'script/generate rspec' and 'script/
generate rspec_model Note' and tried to run 'note_spec.rb' and I
encountered this error:
On Mon, Jun 8, 2009 at 12:21 AM, Salil Gaikwad wrote:
> Hi All,
>
> Any Update on this topic.
>
> I still not found any solution for a following method.
>
> it "should be active if controller is same" do
> tab_class('tab').should include('active')
> end
Please read http://wiki.github.com/dche
Hi All,
Any Update on this topic.
I still not found any solution for a following method.
it "should be active if controller is same" do
tab_class('tab').should include('active')
end
Regards,
Salil
--
Posted via http://www.ruby-forum.com/.
__
helper.stub! the OP is testing a helper method.
On Tue, Apr 14, 2009 at 9:04 AM, Fernando Perez wrote:
> Try with that:
>
> controller.stub!(:params).and_return({:controller =>
> 'your_controller_name'})
> --
> Posted via http://www.ruby-forum.com/.
>
> Try with that:
>
> controller.stub!(:params).and_return({:controller =>
> 'your_controller_name'})
Nah it doesn't work out,gives same error.
neways thanx for the info.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-user
> it "should be active if controller is same" do
> params = {:controller => 'royalty_statement'}
> tab_class('royalty_statement').should include('active')
> end
>
> but it doesn't work out. it gives me same error as previous.
Nah it doesn't work that way, because remember that RSpec is
Try with that:
controller.stub!(:params).and_return({:controller =>
'your_controller_name'})
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Fernando Perez wrote:
>> it gives me following error
>>
>> undefined local variable or method `params' for
>
> That's normal. Remember that params exists because there is an http
> request issued. In your spec, you don't tell Rspec anything about any
> request. So you could create a mock for pa
> it gives me following error
>
> undefined local variable or method `params' for
That's normal. Remember that params exists because there is an http
request issued. In your spec, you don't tell Rspec anything about any
request. So you could create a mock for params. If I recall correctly
you
On Tue, Apr 14, 2009 at 8:24 AM, Salil Gaikwad wrote:
> following is the method of the helper
>
> module ApplicationHelper
> def tab_class(tab)
>'class="active"' if tab == params[:controller]
> end
> end
>
> i write the spec method as follows
>
> describe ApplicationHelper do
> it "should
following is the method of the helper
module ApplicationHelper
def tab_class(tab)
'class="active"' if tab == params[:controller]
end
end
i write the spec method as follows
describe ApplicationHelper do
it "should be active if controller is same" do
tab_class('royalty_statement').s
29 matches
Mail list logo