How to add body in action text?
Post.rb
has_rich_text :body
test/fixtures/posts.yml
one:
name: <%= Faker::Name.unique.name %>
body: "body"
posts_controller_test.rb
require 'test_helper'
class PostsControllerTest < ActionDispatch::IntegrationTest
setup do
@post = posts(:one)
end
test "should get index" do
get posts_url
assert_response :success
end
end
I run the PostsControllerTest expected success response but got
Minitest::UnexpectedError: ActiveRecord::Fixture::FixtureError: table "posts" has no columns named "body".
Using rails 6.0, Ruby 2.7.1