trying to construct rspec test and get it to pass
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I’m trying to construct this feature test properly and get it to pass in spec/. Currently I’m getting this error, and I’m not sure how to get this branch to pass.

If you would be able to send a PR, I’d apprecate it!

awarded to AgentAntelope

Crowdsource coding tasks.

2 Solutions

Winning solution

You need to do FactoryGirl.build(:proof) instead of just proof.

I added build(:proof) and create(:proof) like this gist and I'm still getting the same error
akshatpradhan over 5 years ago
Like this: https://gist.github.com/AgentAntelope/9457149 The issue is that you're creating the proof but not assigning it to proof, so when you reference that you get an undefined variable error.
AgentAntelope over 5 years ago
@AgentAntelope Would you be able to get me over this next hurdle? The error is in the commit message and is different from my original question. Btw, thank you for the concise answer, it worked! Here's the commit with the error message. https://github.com/akshatpradhan/compliance_chimp/commit/e7cb93fe0710d68346b5166fbf60e7e1b4df20e4
akshatpradhan over 5 years ago

That line:
create(:standard, name: "1.1.1", proof: proof)
expects proof to be a local variable or method - either set the variable, or change it to:
create(:standard, name: "1.1.1", proof: 'some text of proof')

(the soln from the first person is a better fit)

View Timeline