File: attributes_for_spec.rb

package info (click to toggle)
ruby-factory-bot 6.5.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,492 kB
  • sloc: ruby: 9,242; makefile: 6; sh: 4
file content (16 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
describe FactoryBot::Strategy::AttributesFor do
  let(:result) { {name: "John Doe", gender: "Male", admin: false} }
  let(:evaluation) { double("evaluation", hash: result) }

  it_should_behave_like "strategy without association support"

  it "returns the hash from the evaluation" do
    expect(subject.result(evaluation)).to eq result
  end

  it "does not run the to_create block" do
    expect {
      subject.result(evaluation)
    }.to_not raise_error
  end
end