Skip to content

Commit

Permalink
#61 tests modified
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaHany94 committed Apr 8, 2015
1 parent c76a76e commit 47c2555
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/controllers/magazine_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
expect(response).to render_template('showrequests')
end

it 'responds successfully with an HTTP 200 status code' do
get :showrequests
expect(response).to be_success
expect(response).to have_http_status(200)
end

it 'shows joining requests correctly' do
a1 = create(:article)
a2 = create(:article, title: 'Test', plain_body: 'xxxxtestxxxx')
r1 = create(:requestjoiningmagazine)
r2 = create(:article, title: 'Test', plain_body: 'xxxxtestxxxx')
get :search, query: 'xxxxtestxxxx'
expect(assigns(:articles)).to match_array([a1, a2])
end
Expand Down

0 comments on commit 47c2555

Please sign in to comment.