diff --git a/spec/controllers/bundle_contexts_controller_spec.rb b/spec/controllers/bundle_contexts_controller_spec.rb index c0985490..54df6444 100644 --- a/spec/controllers/bundle_contexts_controller_spec.rb +++ b/spec/controllers/bundle_contexts_controller_spec.rb @@ -22,7 +22,7 @@ context 'users persisted in db' do - before { sign_in(User.create(sunet_id: 'foo')) } + before { sign_in(User.create(sunet_id: 'foo@stanford.edu')) } it "should have current_user" do expect(subject.current_user).to_not eq(nil) diff --git a/spec/models/bundle_context_spec.rb b/spec/models/bundle_context_spec.rb index a90e0457..cab8951a 100644 --- a/spec/models/bundle_context_spec.rb +++ b/spec/models/bundle_context_spec.rb @@ -10,7 +10,7 @@ ) end - let(:user) { User.new(sunet_id: "Jdoe") } + let(:user) { User.new(sunet_id: "Jdoe@stanford.edu") } context "validation" do it "is not valid unless it has all required attributes" do diff --git a/spec/models/job_run_spec.rb b/spec/models/job_run_spec.rb index defff2d9..8ce07c65 100644 --- a/spec/models/job_run_spec.rb +++ b/spec/models/job_run_spec.rb @@ -1,5 +1,5 @@ RSpec.describe JobRun, type: :model do - let(:user) { User.new(sunet_id: 'Jdoe') } + let(:user) { User.new(sunet_id: 'Jdoe@stanford.edu') } let(:bc) do BundleContext.new(id: 1, project_name: 'SmokeTest', diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 1454759d..c3d1999c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,7 +1,7 @@ RSpec.describe User, type: :model do context "validation" do - subject(:user) { User.new(sunet_id: "jdoe") } + subject(:user) { User.new(sunet_id: "jdoe@stanford.edu") } it "is not valid unless it has all required attributes" do expect(User.new).not_to be_valid @@ -14,7 +14,7 @@ describe 'enforces unique constraint on sunet_id' do let(:required_attributes) do - { sunet_id: "tempdoe" } + { sunet_id: "tempdoe@stanford.edu" } end before { described_class.create!(required_attributes) } @@ -23,7 +23,7 @@ expect { described_class.create!(required_attributes) }.to raise_error(ActiveRecord::RecordInvalid) end it 'at db level' do - dup_user = described_class.new(sunet_id: "tempdoe") + dup_user = described_class.new(sunet_id: "tempdoe@stanford.edu") expect { dup_user.save!(validate: false) }.to raise_error(ActiveRecord::RecordNotUnique) end end diff --git a/spec/support/bundle_setup.rb b/spec/support/bundle_setup.rb index 01eeeec3..92fff33d 100644 --- a/spec/support/bundle_setup.rb +++ b/spec/support/bundle_setup.rb @@ -13,7 +13,7 @@ def noko_doc(x) end def bundle_context_from_hash(proj) - user = User.create(sunet_id: "Jdoe") + user = User.create(sunet_id: "Jdoe@stanford.edu") cmc = hash_from_proj(proj)["content_md_creation"]["style"] cmc = cmc + "_cm_style" if cmc == "smpl"