Skip to content

Commit

Permalink
Merge pull request #315 from sul-dlss/sunet-email
Browse files Browse the repository at this point in the history
The user.sunet_id is saved w/ the email not the username
  • Loading branch information
jmartin-sul committed Sep 19, 2018
2 parents e8d2fd9 + e91735b commit 5bf6de3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/bundle_contexts_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/bundle_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/models/job_run_spec.rb
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 3 additions & 3 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) }
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/bundle_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5bf6de3

Please sign in to comment.