diff --git a/spec/controllers/magazine_controller_spec.rb b/spec/controllers/magazine_controller_spec.rb index 1b9e9f04..f85bccc0 100644 --- a/spec/controllers/magazine_controller_spec.rb +++ b/spec/controllers/magazine_controller_spec.rb @@ -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