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
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
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
lroca88_: Hello I have Part2 of Hw4 running OK in my computer. But autograder says "Failed coverage test (controllers coverage too low)."
14:57
mikestep_: anyone help with message I have spent 2 days on rspec message Failure/Error: get :director
MMan: do u have any "action" called :director ? (controller#action ... example movies#index, movies#update movies#new )
Jojo: phamh9090 and anyone else who might wanna help me, auto grader controller coverage isn't affected by my tests
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 )
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: Coverage report generated for Cucumber Features, RSpec to /home/saasbook/homeworks/bdd-tdd-cycle/rottenpotatoes/coverage. 66 / 66 LOC (100.0%) covered
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%
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' "
MMan: and everytime u run cucumber/rspec u should get a message like "Coverage report generated for ..... "
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
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
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 :)
Jojo: mikestep_: so i should add assert before get :director? now i have eg. assings(:movies).should ... after it
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
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.
Jojo: so your coverage says that your code in director method isn't tested, though you have some spec tests for it?
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: 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
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.
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.
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
phamh9090: @mike: in your config/routes.rb: you should have something like: match 'movies/:id/same_director' => 'movies#same_director', :as => 'same_director'
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
mikestep_: pham.. I have ..match 'search_by_director/:id' => 'movies#director', :as=> :search_by_director
hfp: This is my routes.rb: gist.github.com/anonymous/e6775dbebf608a89fcc0, this is my paths.rb: gist.github.com/anonymous/ef9e9cb9640b28f0fbe1
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.
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
LionelCarras: You can rake routes to see how it works. :as is the name of the path, :via is the request (get/post/etc)
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_: 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
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: 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
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?
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?
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?
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
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
hfp: phamh9090: I don't understand why I have to add + '/similar'. Isn't the similar_movies_path already interpolated as /movies/:id/similar ?
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)?
lvbcheng: Not sure what you mean. Regardless of what paths.rb is for, why do one pattern for one, another pattern for another?
lvbcheng: Even the error file you provided indicated that Cucumber was unhappy with the inconsistency.
21:13
Irrational_Kongt: collabedit.com/s7sw6 Pair Programming special event, any HW. Everyone welcome! Starts in 1.5 hrs.
LuboN: well to have a wife.. migane needs to know programming to earn some $$.. so.. it's chicken/egg problem..
22:30
Irrational_Kongt_: collabedit.com/s7sw6 Pair Programming special event, any HW. Everyone welcome, starts now!
« first day (48 days earlier) ← previous day next day → last day (1088 days later) »