This repository has been archived by the owner on Nov 22, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from bitzesty/chunked-upgrade-gems
upgrade sso gems
- Loading branch information
Showing
6 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Sequel.migration do | ||
up do | ||
alter_table :users do | ||
add_column :disabled, FalseClass, default: false | ||
end | ||
end | ||
|
||
down do | ||
alter_table :users do | ||
drop_column :disabled | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require "spec_helper" | ||
require "gds-sso/lint/user_spec" | ||
|
||
describe User do | ||
describe "gds-sso" do | ||
it_behaves_like "a gds-sso user class" | ||
end | ||
|
||
describe "#update_attributes" do | ||
let!(:user) { create :user } | ||
let(:attrs) { | ||
attributes_for :user | ||
} | ||
|
||
before { | ||
user.update_attributes(attrs) | ||
user.reload | ||
} | ||
|
||
it { | ||
expect(user.name).to eq(attrs[:name]) | ||
expect(user.email).to eq(attrs[:email]) | ||
} | ||
end | ||
|
||
describe "#create!" do | ||
describe "valid" do | ||
let(:attrs) { | ||
attributes_for :user | ||
} | ||
|
||
it { | ||
expect { | ||
User.create!(attrs) | ||
}.to change{ User.count }.by(1) | ||
} | ||
end | ||
|
||
describe "invalid" do | ||
let!(:user) { create :user } | ||
let(:attrs) { | ||
attributes_for(:user).merge( | ||
id: user.id | ||
) | ||
} | ||
|
||
it { | ||
expect { | ||
User.create!(attrs) | ||
}.to raise_error(Sequel::Error) | ||
} | ||
end | ||
end | ||
end |