Fix tests related to different root_url

This commit is contained in:
Jonathon Wilson 2012-11-18 11:27:20 -06:00
parent 2c8fb48e53
commit 6f71a80017
9 changed files with 24 additions and 32 deletions

View File

@ -10,6 +10,16 @@
(function(context,$) {
context.JK = context.JK || {};
// Static function to hide the 'curtain' which hides the underlying
// stuff until we can get it laid out. Called from both the main
// client as well as the landing page.
context.JK.hideCurtain = function(duration) {
setTimeout(function() {
$('.curtain').fadeOut(2*duration);
}, duration);
};
context.JK.Layout = function() {
// privates

View File

@ -15,13 +15,6 @@
return template;
};
context.JK.hideCurtain = function(duration) {
setTimeout(function() {
$('.curtain').fadeOut(2*duration);
}, duration);
};
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.

View File

@ -2,9 +2,6 @@ class ClientsController < ApplicationController
include UsersHelper
# have to be signed in currently to see this screen
# before_filter :signed_in_user
def index
# use gon to pass variables into javascript
gon.websocket_gateway_uri = Rails.application.config.websocket_gateway_uri

View File

@ -59,13 +59,11 @@ class SessionsController < ApplicationController
def complete_sign_in(user)
sign_in user
#redirect_back_or music_sessions_url
redirect_back_or client_url
end
def destroy
sign_out
#redirect_to root_url
redirect_to client_url
end

View File

@ -10,7 +10,7 @@
<!-- Normal signed-in user content -->
<div layout="header" class="header" style="display:none;">
<h1>JamKazam</h1>
<h1>Jamkazam</h1>
<div class="search">
<input type="text" class="searchtextinput" placeholder="Search for Bands, Musicians and Fans"/>
</div>
@ -40,7 +40,7 @@
<div class="userinfo">
<!-- gravatar_for current_user, size: 52, hclass: "avatar medium" -->
<div class="username">
<h2>User Name Here with Template </h2>
<h2>TODO Name</h2>
<%= image_tag "down_arrow.png", :class=> "profile-toggle" %>
<ul>
<li><a layout-link="account">Profile</a></li>

View File

@ -5,7 +5,7 @@
<%= link_to "Jamkazam", root_path, id: "logo" %>
<nav>
<ul class="nav pull-right">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Home", '/oldhome' %></li>
<li><%= link_to "Help", help_path %></li>
<% if signed_in? %>
<li><%= link_to "Music Sessions", music_sessions_url %></li>

View File

@ -14,6 +14,9 @@ SampleApp::Application.routes.draw do
#root to: 'static_pages#home'
root to: 'clients#index'
# This page is still here, and is under test. Keep a route to it.
match '/oldhome', to: 'static_pages#home'
match '/signup', to: 'users#new'
match '/email_sent', to: 'users#email_sent'
match '/signin', to: 'sessions#new'

View File

@ -34,19 +34,9 @@ describe "Authentication" do
click_button "Sign in"
end
# it now goes to /music_sessions
it { should have_selector('title', text: "Music Sessions") }
it { should have_link('Users', href: users_path) }
it { should have_link('Profile', href: user_path(user)) }
it { should have_link('Settings', href: edit_user_path(user)) }
it { should have_link('Sign out', href: signout_path) }
it { should_not have_link('Sign in', href: signin_path) }
describe "followed by signout" do
before { click_link "Sign out" }
it { should have_link('Sign in') }
end
# Successful sign-in goes to the client
it { should have_selector('title', text: "Jamkazam") }
it { should have_selector('h1', text: "Jamkazam") }
end
end
@ -78,9 +68,10 @@ describe "Authentication" do
click_button "Sign in"
end
it "should render the default (profile) page" do
it "should render the signed-in client page" do
# it now goes to /music_sessions
page.should have_selector('title', text: "Music Sessions")
page.should have_selector('title', text: "Jamkazam")
page.should have_selector('h1', text: "Jamkazam")
end
end
end

View File

@ -5,7 +5,7 @@ describe "Static pages" do
subject { page }
describe "Home page" do
before { visit root_path }
before { visit '/oldhome' }
it { should have_selector('h1', text: 'Jam') }
it { should have_selector('title', text: full_title('')) }
@ -42,7 +42,7 @@ describe "Static pages" do
end
it "should have the right links on the layout" do
visit root_path
visit '/oldhome'
click_link "About"
page.should have_selector 'title', text: full_title('About Us')
click_link "Help"