Created
April 7, 2010 20:37
-
-
Save NickClark/359415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Admin::SettingsController do | |
describe "as an administrator" do | |
before(:each) do | |
login_admin | |
end | |
describe "handling GET index" do | |
before(:each) do | |
@setting_1 = mock_model(Setting) | |
@settings = [@setting_1] | |
end | |
def do_get | |
get :index | |
end | |
it "should find all the settings and assign them for the view" do | |
Setting.should_receive(:find).with(:all).and_return(@setting_1) | |
do_get | |
assigns[:settings].should == @settings | |
end | |
it "should render the index template" do | |
do_get | |
response.should render_template(:index) | |
end | |
end | |
end | |
describe "as a standard user" do | |
before(:each) do | |
login_standard | |
end | |
it "should disallow access" do | |
allowed_actions.should_not == all_actions | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment