Sha256: 2434fe789f1932b027c56d68b043d633e7e9690ffc8763498013618491a17bc3

Contents?: true

Size: 945 Bytes

Versions: 20

Compression:

Stored size: 945 Bytes

Contents

require 'spec_helper'

describe TermsOfServiceAgreementsController do
  before(:each) do
    sign_in(user)
  end
  describe 'without already agreeing' do
    let(:user) { FactoryGirl.create(:user, agreed_to_terms_of_service: false) }

    describe '#new' do
      it 'renders a form for agreement if not already agreed' do
        get :new
        response.status.should == 200
        expect(response).to render_template('new')
      end
    end
    describe '#create' do
      it 'redirects to remember location if agreed' do
        post :create, commit: controller.i_agree_text
        response.status.should == 302
        expect(response).to redirect_to(new_classify_concern_path)
      end
      it 'flashes a notice if you disagree and renders new' do
        post :create, commit: controller.i_do_not_agree_text
        expect(response).to render_template('new')
        response.response_code.should == 200
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
curate-0.6.6 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.6.5 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.6.4 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.6.3 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.6.1 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.6.0 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.6 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.5 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.4 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.2 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.1 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.5.0 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.4.2 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.3.2 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.3.1 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.2.0 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.1.3 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.1.2 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.1.1 spec/controllers/terms_of_service_agreements_controller_spec.rb
curate-0.1.0 spec/controllers/terms_of_service_agreements_controller_spec.rb