Skip to content

Instantly share code, notes, and snippets.

@oojikoo-gist
Created January 13, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oojikoo-gist/99c67847b281c37e0581 to your computer and use it in GitHub Desktop.
Save oojikoo-gist/99c67847b281c37e0581 to your computer and use it in GitHub Desktop.
rails: rspec model example
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