Displaying 1 result from an estimated 1 matches for "usermockviewhelper".
2007 Aug 11
2
Rspec and acl_system2 plugin
...restrict_to "admin" do -%>
<ul id="admin-tabs">
<li> /users Users management </li>
</ul>
<% end -%>
Then in my spec file ''spec/views/layout/admin.rhtml_spec.rb'' :
describe "Layout Admin if admin user" do
include UserMockViewHelper
it "should display the admin tabs" do
login_as :admin
render ''layouts/admin''
response.should have_tag("ul#admin-tabs")
end
end
the UserMockViewHelper module handle the mocking of the current user :
module UserMockViewHelper
def login_as(u...