xaviershay / enki

A Ruby on Rails blogging app for the fashionable developer. It's better than Mephisto or SimpleLog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue while adding comments

jiten19 opened this issue · comments

Hello when i add a new comment it just spits out"We're sorry, but something went wrong."
I am using mysql db .

Please check log/development.log and paste the error here.

Hello
I just ran a test it gives so much failures :(
Failures:

  1. Admin::PostsController handling DELETE to destroy, JSON request renders json including a description of the post
    Failure/Error: JSON.parse(response.body)['undo_message'].should == 'hello'
    NoMethodError:
    undefined method `parse' for JSON:Module

    ./spec/controllers/admin/posts_controller_spec.rb:166

  2. Admin::CommentsController handling DELETE to destroy, JSON request renders json including a description of the comment
    Failure/Error: JSON.parse(response.body)['undo_message'].should == 'hello'
    NoMethodError:
    undefined method `parse' for JSON:Module

    ./spec/controllers/admin/comments_controller_spec.rb:129

  3. CommentsController handling commenting with a POST to #index (non-OpenID comment) allows setting of author
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b9c0ce0

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  4. CommentsController handling commenting with a POST to #index (non-OpenID comment) allows setting of body
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b98ff3c

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  5. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of author_url
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b969080

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  6. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of author_email
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b941454

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  7. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of created_at
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b91ee54

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  8. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of updated_at
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b8fc854

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

Something looks really broken here. How are you running the specs? Just with rake? What OS and ruby version? What is the output of git log -n 1?

i am running it on freebsd and i have ruby entreprise 1.8.7-head .
and git log -n 1 shows your last commit

commit 4ba419b
Author: Xavier Shay xavier@rhnh.net
Date: Sat Jul 23 12:11:27 2011 +1000

also i just ran rake for the specs.

hmm. Not sure what the problem is, sorry. Perhaps try bundle exec rake?

same errors with bundle exec rake.

/usr/local/rvm/rubies/ree-1.8.7-head/bin/ruby -S bundle exec rspec ./spec/controllers/admin/comments_controller_spec.rb ./spec/controllers/admin/dashboard_controller_spec.rb ./spec/controllers/admin/health_controller_spec.rb ./spec/controllers/admin/pages_controller_spec.rb ./spec/controllers/admin/posts_controller_spec.rb ./spec/controllers/admin/sessions_controller_spec.rb ./spec/controllers/admin/sessions_routing_spec.rb ./spec/controllers/admin/undo_items_controller_spec.rb ./spec/controllers/archives_controller_spec.rb ./spec/controllers/archives_routing_spec.rb ./spec/controllers/comments_controller_spec.rb ./spec/controllers/pages_controller_spec.rb ./spec/controllers/pages_routing_spec.rb ./spec/controllers/posts_controller_spec.rb ./spec/controllers/posts_routing_spec.rb ./spec/helpers/page_title_helper_spec.rb ./spec/lib/slugorize_spec.rb ./spec/models/comment_activity_spec.rb ./spec/models/comment_spec.rb ./spec/models/delete_comment_undo_spec.rb ./spec/models/delete_post_undo_spec.rb ./spec/models/page_spec.rb ./spec/models/post_spec.rb ./spec/models/stats_spec.rb ./spec/models/tag_spec.rb ./spec/models/tagging_spec.rb ./spec/views/admin/comments/index.html.erb_spec.rb ./spec/views/admin/comments/show.html.erb_spec.rb ./spec/views/admin/dashboard/show.html.erb_spec.rb ./spec/views/admin/pages/index.html.erb_spec.rb ./spec/views/admin/pages/new.html.erb_spec.rb ./spec/views/admin/pages/show.html.erb_spec.rb ./spec/views/admin/posts/index.html.erb_spec.rb ./spec/views/admin/posts/new.html.erb_spec.rb ./spec/views/admin/posts/show.html.erb_spec.rb ./spec/views/admin/sessions/new.html.erb_spec.rb ./spec/views/admin/undo_items/index.html.erb_spec.rb ./spec/views/archives/index.html.erb_spec.rb ./spec/views/layouts/admin.html.erb_spec.rb ./spec/views/layouts/application.html.erb_spec.rb ./spec/views/layouts/login.html.erb_spec.rb ./spec/views/pages/show.html.erb_spec.rb ./spec/views/posts/index.atom.builder_spec.rb ./spec/views/posts/index.html.erb_spec.rb ./spec/views/posts/show.html.erb_spec.rb
/var/www/enki/app/controllers/comments_controller.rb:29: warning: don't put space before argument parentheses
..............F.......................................F...................................................FFFFFF....................................................................................................................................................................

Failures:

  1. Admin::CommentsController handling DELETE to destroy, JSON request renders json including a description of the comment
    Failure/Error: JSON.parse(response.body)['undo_message'].should == 'hello'
    NoMethodError:
    undefined method `parse' for JSON:Module

    ./spec/controllers/admin/comments_controller_spec.rb:129

  2. Admin::PostsController handling DELETE to destroy, JSON request renders json including a description of the post
    Failure/Error: JSON.parse(response.body)['undo_message'].should == 'hello'
    NoMethodError:
    undefined method `parse' for JSON:Module

    ./spec/controllers/admin/posts_controller_spec.rb:166

  3. CommentsController handling commenting with a POST to #index (non-OpenID comment) allows setting of author
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2bacc5d0

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  4. CommentsController handling commenting with a POST to #index (non-OpenID comment) allows setting of body
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2ba8fce8

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  5. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of author_url
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2ba641c4

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  6. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of author_email
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2ba332a4

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  7. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of created_at
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b9f781c

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

  8. CommentsController handling commenting with a POST to #index (non-OpenID comment) forbids setting of updated_at
    Failure/Error: post :create, :year => '2007', :month => '01', :day => '01', :slug => 'a-post', :comment => {
    NoMethodError:
    undefined method `reject' for #Comment:0x2b9c707c

    ./app/controllers/comments_controller.rb:29:in`create'

    ./spec/controllers/comments_controller_spec.rb:68

Finished in 2.43 seconds
276 examples, 8 failures
rake aborted!
ruby -S bundle exec rspec ./spec/controllers/admin/comments_controller_spec.rb ./spec/controllers/admin/dashboard_controller_spec.rb ./spec/controllers/admin/health_controller_spec.rb ./spec/controllers/admin/pages_controller_spec.rb ./spec/controllers/admin/posts_controller_spec.rb ./spec/controllers/admin/sessions_controller_spec.rb ./spec/controllers/admin/sessions_routing_spec.rb ./spec/controllers/admin/undo_items_controller_spec.rb ./spec/controllers/archives_controller_spec.rb ./spec/controllers/archives_routing_spec.rb ./spec/controllers/comments_controller_spec.rb ./spec/controllers/pages_controller_spec.rb ./spec/controllers/pages_routing_spec.rb ./spec/controllers/posts_controller_spec.rb ./spec/controllers/posts_routing_spec.rb ./spec/helpers/page_title_helper_spec.rb ./spec/lib/slugorize_spec.rb ./spec/models/comment_activity_spec.rb ./spec/models/comment_spec.rb ./spec/models/delete_comment_undo_spec.rb ./spec/models/delete_post_undo_spec.rb ./spec/models/page_spec.rb ./spec/models/post_spec.rb ./spec/models/stats_spec.rb ./spec/models/tag_spec.rb ./spec/models/tagging_spec.rb ./spec/views/admin/comments/index.html.erb_spec.rb ./spec/views/admin/comments/show.html.erb_spec.rb ./spec/views/admin/dashboard/show.html.erb_spec.rb ./spec/views/admin/pages/index.html.erb_spec.rb ./spec/views/admin/pages/new.html.erb_spec.rb ./spec/views/admin/pages/show.html.erb_spec.rb ./spec/views/admin/posts/index.html.erb_spec.rb ./spec/views/admin/posts/new.html.erb_spec.rb ./spec/views/admin/posts/show.html.erb_spec.rb ./spec/views/admin/sessions/new.html.erb_spec.rb ./spec/views/admin/undo_items/index.html.erb_spec.rb ./spec/views/archives/index.html.erb_spec.rb ./spec/views/layouts/admin.html.erb_spec.rb ./spec/views/layouts/application.html.erb_spec.rb ./spec/views/layouts/login.html.erb_spec.rb ./spec/views/pages/show.html.erb_spec.rb ./spec/views/posts/index.atom.builder_spec.rb ./spec/views/posts/index.html.erb_spec.rb ./spec/views/posts/show.html.erb_spec.rb failed

See the above commit, please do try again.

yes i think that fixed it , i wonder how was it working for others without the json module.

My guess is maybe it was a load ordering issue? Can't explain the Comment.reject one though.