Sha256: d493baf217da1666f1d71b17d12d19981c1c2094e33c848d6fe093b65e8383fc

Contents?: true

Size: 1010 Bytes

Versions: 7

Compression:

Stored size: 1010 Bytes

Contents

require 'spec_helper'

describe ClassifyConcernsController do
  render_views
  let(:user) { FactoryGirl.create(:user) }

  describe '#new' do
    it 'requires authentication' do
      get :new
      response.status.should == 302
      expect(response).to redirect_to(user_session_path)
    end
    it 'renders when signed in' do
      sign_in(user)
      get :new
      response.status.should == 200
    end
  end

  describe '#create' do
    let(:user) { FactoryGirl.create(:user) }
    it 'redirect to login page if user is not logged in' do
      post :create, classify: { curation_concern_type: 'MockCurationConcern' }
      response.status.should == 302
      expect(response).to redirect_to(user_session_path)
    end

    it 'requires authentication' do
      sign_in(user)
      post :create, classify_concern: { curation_concern_type: 'MockCurationConcern' }
      response.status.should == 302
      expect(response).to redirect_to(new_curation_concern_mock_curation_concern_path)
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curate-0.3.2 spec/controllers/classify_concerns_controller_spec.rb
curate-0.3.1 spec/controllers/classify_concerns_controller_spec.rb
curate-0.2.0 spec/controllers/classify_concerns_controller_spec.rb
curate-0.1.3 spec/controllers/classify_concerns_controller_spec.rb
curate-0.1.2 spec/controllers/classify_concerns_controller_spec.rb
curate-0.1.1 spec/controllers/classify_concerns_controller_spec.rb
curate-0.1.0 spec/controllers/classify_concerns_controller_spec.rb