I am trying to learn rspec and apply what I am learning to an existing rails app.
I am trying to create a mock of a user called "current_user"
I have basically taken this line of code
and placed it before my tests (all of which require a current_user to be defined)
This works. But
I know that this syntax is deprecated and I should be using
syntax but I can't seem to convert it to the new syntax and get it to work.
user = double("user") allow(user).to receive(:current_user).and_return(build_stubbed(:user))
without success. I reality I have no idea what I am doing with this and need to be pointed in the right direction. I have looked extensively for an answer but I suspect this is too basic.
Would appreciate some guidance.