Sha256: 998193f765a5e07d6968270ef0249daeb7fbbedf0458d184af358837924b0744

Contents?: true

Size: 908 Bytes

Versions: 11

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

RSpec.describe MrCommon::Registrations::PublicController, type: :controller do
  describe "#create" do
    it "renders the host new registration template on failure" do
      post :create, params: { registration: { first_name: "" } }
      expect(response.status).to eq 422
    end

    it "redirects to the default success path" do
      registration_params = attributes_for(:registration)
      post :create, params: { registration: registration_params }
      expect(response).to redirect_to registrations_success_index_path
    end

    it "creates a registration record" do
      count = MrCommon::Registration.count
      registration_params = attributes_for(:registration)
      post :create, params: { registration: registration_params }
      difference = MrCommon::Registration.count - count
      expect(difference).to eq 1
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mr_common-2.1.0 spec/controllers/registrations/public_controller_spec.rb
mr_common-2.0.0 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.3.0 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.2.0 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.1.0 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.5 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.4 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.3 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.2 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.1 spec/controllers/registrations/public_controller_spec.rb
mr_common-1.0.0 spec/controllers/registrations/public_controller_spec.rb