Open railyboy opened 12 years ago
Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still. Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994
If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)
We hope to see you on the other side!
hello i am having some issue an unexpected issue with integration testing: this is my autotest error trace: [sample_app (filling-in-layout)]$ rspec spec/ FFF..........
Failures:
1) LayoutLinks should have a Help page at '/help' Failure/Error: response.should have_selector('title', :content=>"Help") expected following output to contain a
2) LayoutLinks should have a About page at '/about' Failure/Error: response.should have_selector('title', :content=>"About") expected following output to contain a
3) LayoutLinks should have a Contact page at '/contact' Failure/Error: response.should have_selector('title', :content=>"Contact") expected following output to contain a
Finished in 0.21778 seconds 13 examples, 3 failures
Failed examples:
rspec ./spec/requests/layout_links_spec.rb:17 # LayoutLinks should have a Help page at '/help' rspec ./spec/requests/layout_links_spec.rb:13 # LayoutLinks should have a About page at '/about' rspec ./spec/requests/layout_links_spec.rb:9 # LayoutLinks should have a Contact page at '/contact'
Note that these links do exits when i visit /help or /about, /contact but it is complaining that i dont have those pages. Can sombody please help on this issue?
As soon as I added the method 'load_and_authorize_resource' to m controllers a bunch of my RSpec tests fail. As I had some outstanding failures I proved to think I have confirmed that its this method by generating a new resource 'purchases' via scaffolding. I am using home grown authentication as per the Hartl tutorial.
With the scaffold in place running 'rspec spec/requests/purchases_spec.rb' fails unless I comment out the call to the method in the purchases controller.
How do I successfully test when using this method?
Here is my controller:
Here is the request spec:
Does this fail because its a scaffold spec as none of the requests specs that I create utilising my understanding of this as applied in the Hartl tutorial?
Here is my authorization_helper.rb file under spec/support.
Being relatively new to RSpec/Rails/Ruby it may be I've misunderstood what needs to be tested.
In my application this all works, its just my testing that is causing the problem. I dearly want to learn good habits as I come from a previous technology area where testing was an after-thought on big programmes of work, so the emphasis that this technology places on up-front testing (TDD/BDD) is a breath of fresh air, but I'm at a point where it would be easy to turn ones back on tests that do not work when the application is working, as there is more to deliver and its holding me up.
Any suggestions will be greatly appreciated and worked through.
Here is the RSpec error: