diff --git a/spec/models/answer_spec.rb b/spec/models/answer_spec.rb new file mode 100644 index 00000000..a082aec9 --- /dev/null +++ b/spec/models/answer_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe Answer do + describe 'association' do + it { should have_many :qanswers } + it { should have_many(:questions).through(:qanswers) } + end + + describe 'validation' do + it 'has valid factory' do + expect(build(:answer)).to be_valid + end + + it{ is_expected.to validate_presence_of(:title) } + end +end