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(: