retrospring/spec/models/answer_spec.rb

20 lines
414 B
Ruby
Raw Normal View History

2015-01-18 14:15:21 +01:00
require 'rails_helper'
RSpec.describe Answer, :type => :model do
before :each do
@answer = Answer.new(
content: 'This is an answer.',
2020-04-19 17:27:42 +02:00
user: FactoryBot.create(:user),
question: FactoryBot.create(:question)
2015-01-18 14:15:21 +01: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