Sha256: c98e24dd50f9566e4fa072870ebdd0e3a92c3c22c14df1f8a10a70bd8917a933

Contents?: true

Size: 963 Bytes

Versions: 3

Compression:

Stored size: 963 Bytes

Contents

require "rails_helper"

describe "Group concern" do
  fixtures :all

  describe "before_validation" do
    describe "creating a moderator" do
      let(:participant) do
        Participant.create!(
          contact_preference: "email",
          study_id: "bar",
          email: "foo@ex.com"
        )
      end

      it "augments default password to ensure validity" do
        allow(SecureRandom).to receive(:base64) { "weak" }

        expect(Participant)
          .to receive(:create!)
          .with(
            password: "1Aaw e a k ",
            password_confirmation:  anything,
            contact_preference: anything,
            display_name: anything,
            email: anything,
            is_admin: true,
            study_id: anything
          )
          .and_return(participant)

        Group.create!(
          title: "Valid",
          arm: arms(:arm1),
          moderator: users(:clinician1)
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
think_feel_do_dashboard-1.2.0.beta1 spec/models/concerns/group_spec.rb
think_feel_do_dashboard-1.1.21 spec/models/concerns/group_spec.rb
think_feel_do_dashboard-1.1.20 spec/models/concerns/group_spec.rb