set up example scaffold with rspec + factorybot tests

This commit is contained in:
Nelson Jovel 2023-12-22 20:43:12 -08:00
parent 533c921a6d
commit d1e6fb1e39
23 changed files with 512 additions and 6 deletions

View file

@ -0,0 +1,26 @@
require "rails_helper"
module Dashboard
RSpec.xdescribe "dashboard/examples/edit", type: :view do
let(:example) do
Example.create!(
text: "MyString",
body: "MyText"
)
end
before(:each) do
assign(:example, example)
end
it "renders the edit example form" do
render
assert_select "form[action=?][method=?]", example_path(example), "post" do
assert_select "input[name=?]", "example[text]"
assert_select "textarea[name=?]", "example[body]"
end
end
end
end