Displaying 1 result from an estimated 1 matches for "thetool".
Did you mean:
thepool
2007 Jul 06
3
stubbing helper methods for View specs
...@u.should_receive(:name).and_return("Hans Muster")
template.should_receive(:logged_in?).and_return(true)
template.should_receive(:current_user).and_return(@u)
end
this works for views / helpers like this:
it "should show bla" do
render "/layouts/thetool"
response.should have_tag("p", "bla")
end
and the view (haml to make things more interesting)
- if logged_in?
%p bla
Now I also use Ezra acl_system2 plugin which defines a "restrict_to"
method that queries some roles. When I stub the methods...