* trying to fix routing issue cleanly

This commit is contained in:
Seth Call 2012-09-01 07:10:59 -05:00
parent 3839a283dd
commit 77b2cc0137
7 changed files with 10 additions and 33 deletions

View File

@ -8,14 +8,14 @@
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
<% if signed_in? %>
<li><%= link_to "Users", jam_ruby_users_path %></li>
<li><%= link_to "Users", users_path %></li>
<li id="fat-menu" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Account <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><%= link_to "Profile", current_user %></li>
<li><%= link_to "Settings", edit_jam_ruby_user_path(current_user) %></li>
<li><%= link_to "Settings", edit_user_path(current_user) %></li>
<li class="divider"></li>m
<li>
<%= link_to "Sign out", signout_path, method: "delete" %>

View File

@ -1,4 +1,4 @@
<a href="<%=jam_ruby_user_path(current_user) %>">
<a href="<%=user_path(current_user) %>">
<%= gravatar_for current_user, size: 52 %>
</a>
<h1>

View File

@ -1,9 +1,9 @@
SampleApp::Application.routes.draw do
scope as: 'jam_ruby' do
scope 'jam_ruby' do
#resources :jam_session_members
#resources :jam_sessions
resources :users
resources :users, :as => nil
end

View File

@ -1,5 +1,5 @@
FactoryGirl.define do
factory :user do
factory :user, :class => "JamRuby::User" do
sequence(:name) { |n| "Person #{n}" }
sequence(:email) { |n| "person_#{n}@example.com"}
password "foobar"

View File

@ -111,31 +111,6 @@ describe "Authentication" do
it { should have_selector('title', text: 'Sign in') }
end
end
describe "in the Microposts controller" do
describe "submitting to the create action" do
before { post microposts_path }
specify { response.should redirect_to(signin_url) }
end
describe "submitting to the destroy action" do
before { delete micropost_path(FactoryGirl.create(:micropost)) }
specify { response.should redirect_to(signin_url) }
end
end
describe "in the Relationships controller" do
describe "submitting to the create action" do
before { post relationships_path }
specify { response.should redirect_to(signin_url) }
end
describe "submitting to the destroy action" do
before { delete relationship_path(1) }
specify { response.should redirect_to(signin_url) }
end
end
end
describe "as wrong user" do
@ -166,4 +141,4 @@ describe "Authentication" do
end
end
end
end
end

View File

@ -45,7 +45,7 @@ describe "User pages" do
end
describe "showing the second page" do
before { visit users_path(page: 2) }
before { visit _users_path(page: 2) }
it "should list the second page of users" do
second_page.each do |user|

View File

@ -7,6 +7,8 @@ require 'active_record'
require 'jam_db'
require 'spec_db'
include JamRuby
# recreate test database and migrate it
db_config = YAML::load(File.open('config/database.yml'))["test"]
SpecDb::recreate_database(db_config)