Created
January 13, 2016 13:25
-
-
Save oojikoo-gist/99c67847b281c37e0581 to your computer and use it in GitHub Desktop.
rails: rspec model example
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
context 'check columns exsitence' do | |
it { is_expected.to respond_to :first_name } | |
it { is_expected.to respond_to :last_name } | |
it { is_expected.to respond_to :profilable } | |
it { is_expected.to respond_to :birth } | |
it { is_expected.to respond_to :gender } | |
it { is_expected.to respond_to :bio } | |
end | |
context 'model validation and associations' do | |
it { is_expected.to belong_to :profilable } | |
end | |
context 'valid Profile' do | |
it 'is valid with accosicated client' do | |
client = create(:valid_client) | |
client_profile = build(:valid_profile) | |
expect(client_profile).to be_valid | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment