Retrospring/spec/models/answer_spec.rb

20 lines
414 B
Ruby
Raw Normal View History

2015-01-18 05:15:21 -08:00
require 'rails_helper'
RSpec.describe Answer, :type => :model do
before :each do
@answer = Answer.new(
content: 'This is an answer.',
2020-04-19 08:27:42 -07:00
user: FactoryBot.create(:user),
question: FactoryBot.create(:question)
2015-01-18 05:15:21 -08:00
)
end
subject { @answer }
it { should respond_to(:content) }
it '#content returns a string' do
expect(@answer.content).to match 'This is an answer.'
end
end