Sha256: 8042b7c5e0fc14f6a1e6db1479ba055140b9eca41f4a31771eba478e64c0a49e

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

require 'spec_helper'

describe Rapidfire::AttemptsController do
  before do
    @routes = Rapidfire::Engine.routes
  end

  # this scenario is possible when there is only 1 radio button question, and
  # user has not selected any option. in this case, browser doesn't send
  # any default value.
  context 'when no parameters are passed' do
    it 'initializes answer builder with empty args' do
      survey = FactoryGirl.create(:survey)

      if Rails::VERSION::MAJOR >= 5
        expect {
          post :create, params: { survey_id: survey.id }
        }.not_to raise_error
      else
        expect {
          post :create, survey_id: survey.id
        }.not_to raise_error
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rapidfire-5.0.0 spec/controllers/rapidfire/attempts_controller_spec.rb
rapidfire-4.0.0 spec/controllers/rapidfire/attempts_controller_spec.rb