Skip to content

Commit

Permalink
Feeds specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Recobra committed Mar 5, 2011
1 parent e0e6ee0 commit 5d63d53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 8 additions & 0 deletions spec/controllers/apps_controller_spec.rb
Expand Up @@ -37,6 +37,8 @@
before(:each) do
sign_in Factory(:admin)
@app = Factory(:app)
@err = Factory :err, :app => @app
@notice = Factory :notice, :err => @err
end

it 'finds the app' do
Expand All @@ -48,6 +50,12 @@
Factory :err, :app => @app
lambda { get :show, :id => @app.id }.should_not raise_error
end

it "should list atom feed successfully" do
get :show, :id => @app.id, :format => "atom"
response.should be_success
response.body.should match(@err.message)
end
end

context 'logged in as a user' do
Expand Down
19 changes: 12 additions & 7 deletions spec/controllers/errs_controller_spec.rb
Expand Up @@ -11,19 +11,24 @@
let(:err) { Factory(:err, :app => app) }

describe "GET /errs" do
render_views
context 'when logged in as an admin' do
before(:each) do
sign_in Factory(:admin)
@notice = Factory :notice
@err = @notice.err
end

it "gets a paginated list of unresolved errs" do
errs = WillPaginate::Collection.new(1,30)
3.times { errs << Factory(:err) }
Err.should_receive(:unresolved).and_return(
mock('proxy', :ordered => mock('proxy', :paginate => errs))
)
it "should successfully list errs" do
get :index
assigns(:errs).should == errs
response.should be_success
response.body.should match(@err.message)
end

it "should list atom feed successfully" do
get :index, :format => "atom"
response.should be_success
response.body.should match(@err.message)
end

it "should handle lots of errors" do
Expand Down

0 comments on commit 5d63d53

Please sign in to comment.