Created
September 26, 2011 06:11
-
-
Save willrjmarshall/1241700 to your computer and use it in GitHub Desktop.
This file contains hidden or 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' | |
| require 'ruby-debug' | |
| describe BroadcastsController do | |
| before :each do | |
| @user = User.make! | |
| sign_in :user, @user | |
| end | |
| describe "Basic crud functions" do | |
| it "should paginate the broadcasts index" do | |
| Broadcast.should_receive(:page).with("2") | |
| get :index, :page => 2 | |
| end | |
| #it "should find a broadcast" do | |
| # Broadcast.should_receive(:find).with("3").and_return(broadcast = mock_model(Broadcast)) | |
| # get :show, :id => 3 | |
| # assigns(:broadcast).should == broadcast | |
| #end | |
| #it "should spawn a new empty broadcast on new" do | |
| # get :new | |
| # response.should_not be_redirect | |
| # assigns(:broadcast).should be_a(Broadcast) | |
| # assigns(:broadcast).user.should == @user | |
| #end | |
| it "should render edit" do | |
| b = Broadcast.make!(:user => @user) | |
| Broadcast.last.should == b | |
| get :edit, :id => b.id | |
| response.should render_template "broadcasts/edit" | |
| end | |
| #it "should save a broadcast on create" do | |
| # controller.stub_chain(:current_user, :broadcasts, :build).and_return(broadcast = Broadcast.make) | |
| # broadcast.should_receive(:save).and_return true | |
| # post :create, :broadcast => {} | |
| # response.should be_redirect | |
| #end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment