Last active
May 21, 2016 23:34
-
-
Save mfifth/66e51447c1d016d190e8345c6dc95e5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The test that is failing | |
require 'rails_helper' | |
RSpec.describe "Users can leave comments" do | |
let(:user) { FactoryGirl.create(:user) } | |
let(:topic) { FactoryGirl.create(:topic, author: user, forum: forum) } | |
let(:forum) { FactoryGirl.create(:forum) } | |
before do | |
login_as(user) | |
visit forum_topic_path(forum, topic) | |
end | |
scenario 'with valid attributes' do | |
click_link "Add Comment" | |
fill_in "Text", with: "This is some random text for a comment" | |
click_button "Create Comment" | |
expect(page).to have_content "Comment has been created." | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The error message | |
undefined method `comments_path' for #<#<Class:0x007f01f0513be8>:0x00000003b43928> | |
Did you mean? font_path | |
Extracted source (around line #1): | |
1 | |
2 | |
3 | |
4 | |
5 | |
<%= simple_form_for([@topic, @comment]) do |f| %> | |
<%= f.input :text %> | |
<%= f.button :submit, class: "new btn-primary" %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The routes, in case there is something wrong here. | |
Rails.application.routes.draw do | |
root 'forums#index' | |
namespace :admin do | |
resources :users | |
root 'application#index' | |
get '/admin/forums' => "forums#index" | |
resources :forums | |
end | |
devise_for :users | |
resources :forums, only: [:show, :index] do | |
resources :topics | |
end | |
resources :topics, only: [] do | |
resources :comments, only: [:create, :new, :destroy, :edit] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mfifth:~/workspace $ rake routes | |
Prefix Verb URI Pattern Controller#Action | |
root GET / forums#index | |
admin_users GET /admin/users(.:format) admin/users#index | |
POST /admin/users(.:format) admin/users#create | |
new_admin_user GET /admin/users/new(.:format) admin/users#new | |
edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit | |
admin_user GET /admin/users/:id(.:format) admin/users#show | |
PATCH /admin/users/:id(.:format) admin/users#update | |
PUT /admin/users/:id(.:format) admin/users#update | |
DELETE /admin/users/:id(.:format) admin/users#destroy | |
admin_root GET /admin(.:format) admin/application#index | |
admin_admin_forums GET /admin/admin/forums(.:format) admin/forums#index | |
admin_forums GET /admin/forums(.:format) admin/forums#index | |
POST /admin/forums(.:format) admin/forums#create | |
new_admin_forum GET /admin/forums/new(.:format) admin/forums#new | |
edit_admin_forum GET /admin/forums/:id/edit(.:format) admin/forums#edit | |
admin_forum GET /admin/forums/:id(.:format) admin/forums#show | |
PATCH /admin/forums/:id(.:format) admin/forums#update | |
PUT /admin/forums/:id(.:format) admin/forums#update | |
DELETE /admin/forums/:id(.:format) admin/forums#destroy | |
new_user_session GET /users/sign_in(.:format) devise/sessions#new | |
user_session POST /users/sign_in(.:format) devise/sessions#create | |
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy | |
user_password POST /users/password(.:format) devise/passwords#create | |
new_user_password GET /users/password/new(.:format) devise/passwords#new | |
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit | |
PATCH /users/password(.:format) devise/passwords#update | |
PUT /users/password(.:format) devise/passwords#update | |
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel | |
user_registration POST /users(.:format) devise/registrations#create | |
new_user_registration GET /users/sign_up(.:format) devise/registrations#new | |
edit_user_registration GET /users/edit(.:format) devise/registrations#edit | |
PATCH /users(.:format) devise/registrations#update | |
PUT /users(.:format) devise/registrations#update | |
DELETE /users(.:format) devise/registrations#destroy | |
forum_topics GET /forums/:forum_id/topics(.:format) topics#index | |
POST /forums/:forum_id/topics(.:format) topics#create | |
new_forum_topic GET /forums/:forum_id/topics/new(.:format) topics#new | |
edit_forum_topic GET /forums/:forum_id/topics/:id/edit(.:format) topics#edit | |
forum_topic GET /forums/:forum_id/topics/:id(.:format) topics#show | |
PATCH /forums/:forum_id/topics/:id(.:format) topics#update | |
PUT /forums/:forum_id/topics/:id(.:format) topics#update | |
DELETE /forums/:forum_id/topics/:id(.:format) topics#destroy | |
forums GET /forums(.:format) forums#index | |
forum GET /forums/:id(.:format) forums#show | |
topic_comments POST /topics/:topic_id/comments(.:format) comments#create | |
new_topic_comment GET /topics/:topic_id/comments/new(.:format) comments#new | |
edit_topic_comment GET /topics/:topic_id/comments/:id/edit(.:format) comments#edit | |
topic_comment DELETE /topics/:topic_id/comments/:id(.:format) comments#destroy | |
mfifth:~/workspace $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment