« first day (48 days earlier)      last day (1088 days later) » 

04:36
Test
04:47
Tes
Test
05:10
Lohhari: i have come to really hate the ruby community's "fail slow, fail seldom" mentality during this course. yesterday i got an error that assigns(:movies) is Nil. i spent an hour trying to figure out why my code sets @movies to Nil. in the end i noticed that i had never called 'get' in that test
Lohhari: any sensible framework would have slapped me in the face when i try to call assigns without calling any http methods but nooo, just return Nil
Lohhari: which to my knowledge is indistinguishable from the situation @movies = Nil
05:32
sampriti: Its not just for the course, the worst thing about ruby is nils.
05:47
Lohhari: in this case it's saying: either your code sets @movies = Nil or your question is not valid
Lohhari: any time i complain about poor interpreter/framework/whatever feedback i'm being told i should know what i'm doing. how could i? i'm a beginner in ruby and rails. it's just an unnecessarily hard platform to learn
Lohhari: thank goodness there is scala. i haven't taken this course but i have high hopes for it coursera.org/course/reactive
NiTT: Full form of HCDP method?
Lohhari: of course scala is also not without its limitations. the compiler and the IDE's are miles away from more mature languages such as c++ and java
Lohhari: and c#
 
8 hours later…
14:09
tansaku: soking_ I'm afraid I can't check your code, and we usually don't encourage posting potential solutions in the chat - perhaps you might try and join a pairing session?
soking_: Oho, are they still going on? Sorry, I thought the course is over so just skipped those sections
soking_: would do that, thanks
butlermh___: yes, I am getting a response from the autograder now
lroca88_: Positive, me too
lroca88_: Hello I have Part2 of Hw4 running OK in my computer. But autograder says "Failed coverage test (controllers coverage too low)."
lroca88_: How can I solve this?
lroca88_: At this moment I have 200/500 ponits
lroca88_: Running reference Cucumber scenarios: 3 out of 3 scenarios passed Score: 40/40
MMan: if its low.. then add more test :)
lroca88: Ok, I have not written TDD tests
lroca88: this is the reason, thanks MMan
MMan: on ur project there are a directory called "coverage" open the index.html u find there.. and u will see a report.. wich part of ur code needs test
MMan: if u remember u added SimpleCov on top of some files.. that gem generate that report
14:57
mikestep_: anyone help with message I have spent 2 days on rspec message Failure/Error: get :director
MMan: rake routes
mikestep_: MMan, I ran routes, and compared to video, its same
MMan: do u have any "action" called :director ? (controller#action ... example movies#index, movies#update movies#new )
MMan: so.. on ur list u should have movies#director then u can call the action get :director
MMan: first line of rake routes...::::: movies GET /movies(.:format) movies#index
mikestep_: mMan I have /search_by_director/:id(.:format) movies#director
MMan: ok
mikestep_: it is last line, any difference?
MMan: looks good
MMan: probably u can also add an alias but get :director should work
mikestep_: that lines starts with alias.. search_by_director /search_by_director/..
MMan: ok
MMan: and where u saved that file steps.rb ??
MMan: rottenpotatoes/spec/controllers/ file.rb <-- ??
MMan: or u dont have any controllers directory under spec ?
mikestep_: i have /spec/controllers/movies_controller_spec.rb
mikestep_: it has get :director , :id => 1, i tried get :index and get same message
Jojo: phamh9090 and anyone else who might wanna help me, auto grader controller coverage isn't affected by my tests
MMan: and u execuring ur specs from rottenpotatos directory ?
Jojo: I submitted a package with tests for director method, and again without those tests, but the coverage for controllers stays in 68%
MMan: Jojo: did u check ur index.html under ur coverage directory ? on ur local machine ?.. there are any red (untested code )
mikestep_: yes, here is com.rottenpotatoes$ bundle exec rake spec
Jojo: yeah, but I think its funny auto graders coverage doesn't change even when I delete some of my controller tests
MMan: Coverage report generated for RSpec to /home/saasbook/homeworks/bdd-tdd-cycle/rottenpotatoes/coverage. 32 / 66 LOC (48.48%) covered.
MMan: that i get when i run rspec
MMan: Coverage report generated for Cucumber Features, RSpec to /home/saasbook/homeworks/bdd-tdd-cycle/rottenpotatoes/coverage. 66 / 66 LOC (100.0%) covered
MMan: n that when i run cucumber
LionelCarras: pastebin.com/qSjBvbcW
LionelCarras: Hi all. Why am I getting this from the autograder?
MMan: : mock is deprecated. Use double instead.
MMan: change all mock for double ?
LionelCarras: What do you use? I thought the lecture is teaching us 'mock'?
blackratdog__: a lot of things are deprecated in current rails but we are using an old version so shouldn't we stick with that for the time being? Just wondering, because if we try to use all the modern stuff it will require a lot of rewriting, such as attr_accessible etc
Jojo: my coverage on my local computer (or rather on the vm) is 22.29%. Then I add the controller tests and run bundle exec rake spec, which results movies_controller.rb coverage 37.5%
Naf4: hi there..
Naf4: why can't I find a coverage directory?
Naf4: I did what the intro help in hw4 suggested..
MMan: do u added the gem on top of the files ?
Naf4: waht gem are you talking about?
MMan: part 2
MMan: "We want you to report your code coverage as well. Add the following lines to the TOP of spec/spec_helper.rb and features/support/env.rb: require 'simplecov' SimpleCov.start 'rails' "
Naf4: yes i did
MMan: and everytime u run cucumber/rspec u should get a message like "Coverage report generated for ..... "
Naf4: never got it...
Naf4: lets try again..
Naf4: after some syntax errors i got 32%
Naf4: what does that index file mean exactly?
MMan: it just a report
MMan: tosee wich part of ur code are executed
MMan: and how many times it got called
MMan: so if u see a red one.. means it was never used, so u need to add some test to cover that part of code
Naf4: we need to get them all up to 100% ?
MMan: im not sure how autograder works.. so
phamh9090: @naf4: > 90% on model, and controller
MMan: u can try.. the autograder.. if it complains.. then u need to add more tests
Naf4: to add the movie director, don;t we need to write tests in the controller spec?
mikestep_: MMan, I run bdd-tdd-cycle/rottenpotatoes$ bundle exec rake spec
phamh9090: @naf4: yes
MMan: mikestep_: when i got that error..was because i had my spec.rb file outside /spec/controllers directory.. and (as stackoverflow) says rspec didnt "detect" my spec file as a controller spec.. so a solution was move the file under "/spec/controller" directory OR add a type :controller
mikestep_: MMan, I put a debugger statment in my spec controller, it hits the debugger line
MMan: u already have ur file under spec/controller... u already have ur route,, and also ur action method.. im not sure whats goin on lol :)
MMan: then.. probably the error its not the "get"... probably something else
Jojo: shouldn't it be in spec/controllers directory? notice the s there
mikestep_: Mman, I added the def director to the MoviesController but the spec doesnt see it
LionelCarras: Is anyone here getting depreciation warning for using 'mock'? Or it's just me?
sampriti: Use stub instead.
phamh9090: @Lionel: I have it too, but it just a warning, anoying but ok.
LionelCarras: phamh9090: Not in the grading of the autograder. I failed the spec part.
mikestep_: jojo, in the controller spec it hits the debugger statment before get :director
Gmaz555: anyone else had problems with flash message not showing up with cucumber test?
phamh9090: @Lionel: I do not think your problem is mock, it is somethingelse
mikestep_: anyone think of how I can check if the spec is using my changed MoviesController
Jojo: mikestep_: so i should add assert before get :director? now i have eg. assings(:movies).should ... after it
mikestep_: jojo, it errors on the get :director , :id=> 1, like it doesnt see the MoviesController
LionelCarras: phamh9090: Even after I changed all the 'mocks' into 'double', I failed the test without getting any error specified but depreciation warning. pastebin.com/i0KXc2Ez Help please
Jojo: mikestep_: I don't understand now. my local coverage is correct
phamh9090: @Lionel: so it fails in auotgrader, but pass locally?
LuboN: do we have to use double?
mikestep_: jojo, I followed tut. but after adding def director, my spec doesnt see it
LionelCarras: phamh9090: yes
Jojo: mikestep_: in your local machine? or autograder?
phamh9090: @Lionel: yesterday Ernst_ found out that his vi left some wierd swap files, and he have to delete all those files to make the grader happy.
mikestep_: jojo on my local machine
LionelCarras: phamh: swap files?
Jojo: so your coverage says that your code in director method isn't tested, though you have some spec tests for it?
mikestep_: jojo, I not that far, I by controller spec errors with get :director not found
Syriusz: ufff finally hw4 400/500. So a few more tests for controlers & 500 is achievable :-)
Jojo: mikestep_: did you add the method to your app/controllers/movies_controller.rb?
phamh9090: @Lion: temporay files that the editor save. So try to go through all of your folders and delete files that not relevant to you. If you run git status, it will show files that git does not track.
Jojo: Syriusz: please tell if you can increase controller coverage
mikestep_: jojo, I added def director render :index end, but the spec doesnt see it
Jojo: mikestep_: do you have route for director? i'm not sure if its needed for spec... or maybe the problem is with render :index? even if you remove it, the spec should at least see the method
Jojo: but i'm not professional here... just learning ruby and rails myself
phamh9090: @jojo: same here
Syriusz_: My investigation give me clue to write tests for code which was already prepared like 'show', destroy', etc ... however I do not think I am right. And I do to think it is according to HW4 author intentions.
MMan: if u add debugger before render.. it should stop there...
mikestep_: jojo, me too I appreciate the help and thoughts,
Jojo: (:
MMan: IF stops.. then its working...
mikestep_: jojo, no matter what I do to MoviesController, I have the get error message
mikestep_: MMan ok, I will try the debugger before render
phamh9090: @Syrius: you have to write test code for current codes to pass the coverage tests. For starter calling those functions will add the coverage.
mikestep_: MMan, it hits debugger in controller spec but errors before debugger in def director
phamh9090: @mike: it means your spec file has a problem, look at that line
LionelCarras: The autograder is complaining without giving me any clues about what my problem is, and my spec is running well locally. pastebin.com/6DdBJtms
mikestep_: pham.. my spec file is ..get :director :id=>1 ... same a tutorial
mikestep_: that is get :director, :id=>1
phamh9090: @mike: what is in your route?
Syriusz_: Thanx @phamh9090
mikestep_: pham.. search_by_director /search_by_director/:id(.:format) movies#director
blackratdog__: what is the extra dot for before :format?
mikestep_: black.. I dont know, I think it went in automatically
blackratdog__: well I don't think it should be there
demoniszcze: any one up for HW4 in like... an hour and a half?
LionelCarras: phamh9090: Where does .swp file normally located?
phamh9090: @mike: in your config/routes.rb: you should have something like: match 'movies/:id/same_director' => 'movies#same_director', :as => 'same_director'
phamh9090: @Lion: .swp files are in the same folder as orginal files.
powerchord: I'm having trouble just getting an rspec test to run
powerchord: I have /spec/controllers/movies_controller_spec.rb and in it I have "describe MoviesController do...end" but I'm "getting uninitialized constant MoviesController" when I try run rspec
LionelCarras: phamp9090: I checked all the subfolders in hw4.tar.gz and there is no .swp file
powerchord: Do I need to require movies_controller.rb in the test file?
LionelCarras: powerchord: I think you need to require 'spec_helper.rb'
powerchord: yes thanks.. that's what I was missing
mikestep_: pham.. I have ..match 'search_by_director/:id' => 'movies#director', :as=> :search_by_director
LionelCarras: mikestep: I think you need :via -> :get/:post
hfp: I don't get the hint about RESTful routes.
phamh9090: @Lion: did you see any files other than the relevant files?
LionelCarras: I am dying......Why do I fail when I don't even get a warning nor an error from the autograder???
Lohhari: have i missed a step if i don't have the directors in my test database, or am i supposed to input them manually?
phamh9090: @Lion: can you printf in your spec file to see where does it bomb. It is too bad we can not see a better error log.
Lohhari: oh yeah, nevermind, they're in the feature file
LionelCarras: phamh9090: It's working properly in the vm.
shaokaiwen: hello
phamh9090: @Lion: we just try to find out what errors the grader see
shaokaiwen: I have a question, how to test redirect to detailed page. I use response.should redirect_to {:controller=>'movies, :id=>1, :action=>'show', :movie=>@fake_movie
shaokaiwen: from REST point of view, it should be ~/1?movie information
shaokaiwen: anyone has any comment?
mikestep_: lionel.. good idea but rake routes dies on the /
LionelCarras: mikestep: I mean just using :via on the match for your search_by_director
mikestep_: Lion.. do you mean to replace the :as with :via?
LionelCarras: nope, using both :as and :via
phamh9090: @hfp: what is in your edit haml file?
LionelCarras: You can rake routes to see how it works. :as is the name of the path, :via is the request (get/post/etc)
mikestep_: Lion.. I added :via => :get/:post, when rake routes is run it errors on the /
LionelCarras: Nope, :via => :get if you want to get data and display it :via => :post if you have a form and want to submit the data. Choose ONE of them
mikestep_: ok, thanks I will try
mikestep_: lion.. message is Failure/Error: get :director... undefined method `get', using ,via=>:get
LionelCarras: mikestep: I encourage you to search 'match' and read some documentation of it. Have you typed it correctly? It is :via
phamh9090: @shao: try response.should redirect_to movie_path, {:id => 1} # assuming you have that movie
LionelCarras: mikestep: guides.rubyonrails.org/routing.html << Here is one of the source to get you started about routing
hfp: phamh9090: This is my edit movie haml file: gist.github.com/anonymous/d6d327df7b9e650d6e7f
mikestep_: yes, I left the : off the note but here is the actual line :as=> :search_by_director, :via => :get , I will read the tab
hfp: phamh9090: I put the wrong link in the show file it seems
hfp: phamh9090: Is my routes the right way to do? Or is there a better way? Because with this routes file, I will also need to create an extra view
phamh9090: @hfp: it should be in your show template
hfp: phamh9090: Wait. The link to 'Similar Movies' is on the show view, not the edit view. Do you mean the link should be on the edit view?
phamh9090: @hfp: you will need to create same_director view template
phamh9090: @hfp: it should be in the show template. what is in it now?
hfp: phamh9090: This is the show template: gist.github.com/anonymous/28097a244a67b9cb77b5
hfp: (I modified the link that was wrong before you mentionned the views)
hfp: Now cucumber fails because it can't find the similar view, which makes sense. I just want to make sure I did it like you meant?
shaokaiwen: Thanks @phamh
shaokaiwen: It worked.
phamh9090: @hfp: in the show template use this ..., similar_movies_path(@movie) + '/similar'
phamh9090: @hfp: in your routes.rb try match 'movies/:id/similar'
hfp: phamh9090: Yes we tried that before but we couldn't access that specific path because we couldn't name it. That's why we decided to make a separate path... Is there a way to do what you say and name it?
phamh9090: @hfp: what is rake routes sayings now?
hfp: phamh9090: It has /movies/:id/similar movies/:id#similar on top of the list but it has no name so I'm not sure how I can use route_name_path(id) on it
phamh9090: @hfp: picky rails: in your routes,rb: use 'similar_movies' not :similar_movies
hfp: Ok I have this now: match 'movies/:id/similar', :as => :similar_movies and rake route gives similar_movies /movies/:id/similar(.:format) movies/:id#similar
phamh9090: @hfp: then similar_movies_path(@movie) + '/similar' will work for you now
hfp: phamh9090: I don't understand why I have to add + '/similar'. Isn't the similar_movies_path already interpolated as /movies/:id/similar ?
phamh9090: @hfp: maybe, try it both way
lvbcheng: hfp: Stupid question but in paths.rb why are you not using the same pattern as that used for /^the edit movie page for .../?
lvbcheng: You have when /^the Similar Movies page for "(.*)"$/ then similar_movies_path($1). Note the $1.
lvbcheng: For edit movie page you have: when /^the edit page for "(.*)"$/ then edit_movie_path(Movie.find_by_title($1))
lvbcheng: Note the use of Movie.find_by_title($1). Presumably you want the backref from the Cucumber feature to contain the movie title, yes? Wouldn't you want/need Movie.find_by_title($1)?
phamh9090: @lvbcheng: paths.rb is for rails. Other files are for cucumber.
lvbcheng: Not sure what you mean. Regardless of what paths.rb is for, why do one pattern for one, another pattern for another?
lvbcheng: In my completed HW, edit and similar are identical.
lvbcheng: Even the error file you provided indicated that Cucumber was unhappy with the inconsistency.
lvbcheng: expected: "/movies/similar/Star%20Wars" got: "/movies/1" (using ==) (RSpec::Expectations::ExpectationNotMetError)
18:35
demoniszcze: It starts now! HW4 part 1 - welcome all!
LuboN: demoniszcze: why hangouts? :(
phamh9090: @lvbcheng: rails is server program. cucumber is test program. They have different interface.
Lohhari: ah, 500/500. course done
18:52
LuboN: demoniszcze: i would love to join but i don't have hangouts..
blackratdog__: it's possible to watch the stream without joining hangouts
blackratdog__: congrats Lohhari!
19:15
vladimir_zahradnik: ls
phamh9090: @Lohhari: now you can have a beer (or two)
blackratdog__: No he can't, he has to start studying for part 2 :-p
avatarX: Are their archived solutions for past assignments?
avatarX: I mean like elegant solutions
blackratdog__: if there were, people would just copypasta them into the current graders lol
blackratdog__: maybe with minor amendments in some places
avatarX: For sure, but option programming puzzles sites allow you to see the top solutions once you have gotten the correct answer
avatarX: often*
phamh9090: @avatarX: Sam will say: he can show you, but he has to kill you after that.
19:57
eoinzy: evening all. just wondering for hw 2-2 will the haml code work as is if i have the correct variables set up
20:09
abjx: eoinzy, the haml code provided in hw2-2 needs to be modified to meet the expectations given under "important for grading" and "hints and caveats"
eoinzy: yeah i dont really know how to pass the values into the form
eoinzy: where does the array have to be declared etc?
eoinzy: for the ratings that is
phamh9090: @eoinzy: you need to assign @ratings_xx variable in your controller, and use it in your view haml
eoinzy: cool, thanks
eoinzy: you mean all_ratings?
phamh9090: @eoinzy: yes
20:47
Syriusz: uff hw4 500/500. Done
21:13
Irrational_Kongt: collabedit.com/s7sw6 Pair Programming special event, any HW. Everyone welcome! Starts in 1.5 hrs.
Irrational_Kongt: I'll match you with a partner.
Irrational_Kongt: Event time: 22:30 - 1:30 utc (3:30p - 6:30p US Pacific time)
Irrational_Kongt: Hangouts is optional
blackratdog__: sounds a bit like speed dating
migane: lol, I want it , I want it!!!
LuboN: migane: speed dating or pair programming?
migane: LubN: what do you think I want more? ;-)
LuboN: migane: depends if you're on happy path or sad one :)
migane: happy path always.
LuboN: well to have a wife.. migane needs to know programming to earn some $$.. so.. it's chicken/egg problem..
migane: migane is already a wife, and not in mood to have one, and also did some programming for last 40 years, so just need to earn some money. Maybe to do some poultry farming on her balcon, who knows.
LuboN: hmm.. wonder how to rspec that :)
21:54
smooth3k_: Hi guys, can someone please clarify regarding HW4: should I actually implement a search_by_director Model method, or just stub it out?
migane: You should stub it first, then implement it.
smooth3k_: cheers migane, that makes sense
Rojo: hi everyone
Rojo: i'm about to write tests for movies_controller. should I use a fixture to test the results of searching by id/name?
22:18
migane: I would not use a fixture here, because what is testing here is just the director name, not the whole record with all its fields. But well, that's just me.
22:30
Irrational_Kongt_: collabedit.com/s7sw6 Pair Programming special event, any HW. Everyone welcome, starts now!
22:45
Rojo: migane: so we should not test the entire model and controller?
22:56
phamh9090: @rojo: you must test them all for the coverage
phamh9090: @rojo: you can stub out the model when you test the controller, and vice versa
Rojo: thnx phamh9090 :)
phamh9090: @rojo: yw
binarypulsar: For HWK 4 I seem to be missing a few points. Can you tell me how the 500 points is broken out.
phamh9090: @binary: 40% for rspec, 20% for coverage, 40% cucumber
binarypulsar: phamh9090: thanks. I got 200 out of 500. I got full credit for cucumber but % for rspec and coverage I guess. I do have tests but having trouble with paths and routes.
binarypulsar: phamh9090: % meant 0 %
Materiari: what kind of trouble with paths and routes?
phamh9090: @binary: you need to have rspec pass to get the next 40%, and based on rspec your coverage need > 90% on both model and controller
23:29
binarypulsar: Materiari: similar_movies_path not found, and some routes not found, phamh9090: coverage is at 72%, need more tests or get failing tests working?
phamh9090: @binary: pick one failing route and debug from there. what route do you want to debug?
migane: Rojo: sorry for the delay, you want to test the movie controller, but you can test it with fake values directly inside the test code. idem for the model.

« first day (48 days earlier)      last day (1088 days later) »