We deprecated controller and view specs on the grounds that they were
brittle, and were a poorer measure of user experience than feature
specs. However, feature specs have their own problems: they're much
slower to run, and flakier (see #901). We also ran into a few cases
where feature specs erroneously passed because they were checking for
the presence of a string that occurred in the error page!
Hence, we're cautiously un-deprecating controller and view specs.
Fixes#1132
* FactoryGirl Changed to FactoryBot
file fix
changes based on comments received
Bundle Update on 2017-10-29
style update to align hash literal
added package-lock
* indentation fixes with rubocop
* name added to contributors
the tests generated by 'rails g scaffold...' are boring and brittle.
they don't actually test anything other than the rails framework, and
they were causing us all kinds of trouble. we've started to blow them
away (and raised a PT chore to remove them from other controllers in due
course).
- still trying to make sure we explicitly use a real member, not just
assume there's one with id = 1
- also it looks like the tests for post activity are passing for obscure
reasons on sqlite when they shouldn't be. this is a known bug
(https://www.pivotaltracker.com/story/show/51280861) apparently
invisible to us under sqlite.
All are fine except for plantings. I'm pretty sure hte problem is to do
with these two lines in app/model/ability.rb
can :update, Planting, :garden => { :owner_id => member.id }
can :destroy, Planting, :garden => { :owner_id => member.id }
I'm pretty sure that's the right syntax (according to
https://github.com/ryanb/cancan/wiki/Defining-Abilities) but since it's
the update and delete actions that are failing, I guess I must have it
wrong somehow. Any hints?
There's still probably stuff broken, but this seemed like a good spot to
commit. Sorry for the enormous chunk of code. I was attempting to
update the views, but found that I needed to update a few things
elsewhere as well to make them work.