gotealeaf/myflix — pull request #79 by rjewell2200 (2014-03-31 19:36:32+00:00)
Title: Feature specs capybara -- finishes week 3

1) there's a source code problem with the spec/model/user.rb. The following code:
it { should have_many(:queue_items).order(:position) }
will create an error if the object type of the argument passed in to, .order, does not match the method's argument in the user model: has_many :queue_items, -> { order('position') }

String vs Symbol...Symbol vs String -- Kevin as well as the rest of the class dived deep into thoughtbot's shoulda matchers and were unclear as to whether the problem belonged to the gem or to rails source code.

2) in my spec/features/user_interacts_with_queue_spec, I put all of the methods that abstract away the code on top of the file. I don't know if that was the right decision.

3) for, describe "POST create", in spec/controllers/queue_items_controller_spec, I had to comment out, let(:current_user) {Fabricate(:user)}, because it was producing multiple user objects in my spec. I don't know why or how this is possible. Also without this let command, I have no idea how users are entering my spec or from where. Any help in shedding some light on this would be great. I suspect my macro I use in the before do block is to blame -- but that puzzles me because i thought variables in the before do block lose their meaning once outside this blocks scope....

4) I also implemented the queued_item? method in the user.rb file differently than Kevin. I kept on running into ActiveRecord::Associations::CollectionProxy::ActiveRecord_Associations_CollectionProxy_QueueItem:0x007ff7f6bd27e8
when I followed his method, which -- funny enough -- I believe was to blame for the source code problem in item number one. Everything seemed to boil down to a relation between objects that either the gem could not handle or that rails source code did not articulate well enough.

5) I have a bunch of commented out code in my, spec/features/user_interacts_with_queue_spec, because I was tracking what Kevin was doing in the solutions and trying out each execution of the functioning code. I'm still not too sure if I understand the commented out code, but I definitely understand the implementation code I went with.