-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure bank organization units (#4432)
* WIP Added Custom request units at ogranizational level * Add unique validation to custom organization unit name * Added flipper conditionals and specs * Fixed the button name and delete issue * Updated to allow organizations to delete units * Clean out some lint! * Use select2 in tags-mode for Bank unit configuration * Modify select2 to allow multiple instances on the same page * Update spec to match request units param * Hide the select2 drop-down for units [#4396] * Use unit-names instead of id's when configuring bank [#4396] * Update some org-unit config specs [#4396] * Remove outdated comment [#4396] * Use a dup of params and don't mutate the original [#4396] * Remove implicit rails_helper require [#4396] * Explicitly check for packs-disabled case [#4396] * Move most organization system specs to request spec [#4396] * Clean out some lint [#4396] * Switch two more unit-name validation consts [#4396] --------- Co-authored-by: Liz Catoe <liz.catoe@priviahealth.com> Co-authored-by: srinikotla <38926870+srinikotla@users.noreply.github.com>
- Loading branch information
1 parent
6e72b95
commit d4c64a0
Showing
11 changed files
with
339 additions
and
161 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
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,25 @@ | ||
# == Schema Information | ||
# | ||
# Table name: units | ||
# | ||
# id :bigint not null, primary key | ||
# name :string not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# organization_id :bigint | ||
# | ||
|
||
RSpec.describe Unit, type: :model do | ||
let!(:organization) { create(:organization) } | ||
let!(:unit_1) { create(:unit, name: "WolfPack", organization: organization) } | ||
|
||
describe "Validations" do | ||
it "validates uniqueness of name in context of organization" do | ||
expect { described_class.create!(name: "WolfPack", organization: organization) }.to raise_exception(ActiveRecord::RecordInvalid).with_message("Validation failed: Name has already been taken") | ||
end | ||
end | ||
|
||
describe "Associations" do | ||
it { should belong_to(:organization) } | ||
end | ||
end |
Oops, something went wrong.