-
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update simplecov config, increase coverage (#1120)
- Loading branch information
1 parent
e5203fe
commit ec12be8
Showing
5 changed files
with
112 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SimpleCov.start 'rails' do | ||
# any custom configs like groups and filters can be here at a central place | ||
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
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 |
---|---|---|
|
@@ -29,14 +29,32 @@ | |
# super_admin :boolean default(FALSE) | ||
# last_request_at :datetime | ||
# | ||
require "rails_helper" | ||
|
||
RSpec.describe User, type: :model do | ||
it "has a valid factory" do | ||
expect(build(:user)).to be_valid | ||
end | ||
|
||
context "Associations" do | ||
it { | ||
expect(described_class.reflect_on_association(:organization).macro) | ||
.to eq(:belongs_to) | ||
} | ||
it { | ||
expect(described_class.reflect_on_association(:feedback_messages).macro) | ||
.to eq(:has_many) | ||
} | ||
end | ||
|
||
context "Validations >" do | ||
it "requires a name" do | ||
expect(build(:user, name: nil)).not_to be_valid | ||
expect(build(:user, name: "foo")).to be_valid | ||
end | ||
it "requires an email" do | ||
expect(build(:user, email: nil)).not_to be_valid | ||
expect(build(:user, email: "[email protected]")).to be_valid | ||
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
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