* VRFS-767, VRFS-781 - create account page updated, web layout will now expand black bar as needed

This commit is contained in:
Seth Call 2013-10-22 12:38:21 -05:00
parent 333d158fc6
commit b918406edf
27 changed files with 542 additions and 495 deletions

View File

@ -652,7 +652,7 @@ module JamRuby
# throws ActiveRecord::RecordNotFound if instrument is invalid
# throws an email delivery error if unable to connect out to SMTP
def self.signup(first_name, last_name, email, password, password_confirmation, terms_of_service, subscribe_email,
def self.signup(first_name, last_name, email, password, password_confirmation, terms_of_service,
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
user = User.new
@ -660,7 +660,7 @@ module JamRuby
user.first_name = first_name
user.last_name = last_name
user.email = email
user.subscribe_email = subscribe_email
user.subscribe_email = true
user.terms_of_service = terms_of_service
user.musician = musician

View File

@ -91,12 +91,12 @@
function navToEditIdentity() {
resetForm()
window.location = '#/account/identity'
window.location = '/client#/account/identity'
}
function navToEditProfile() {
resetForm()
window.location = '#/account/profile'
window.location = '/client#/account/profile'
}
function navToEditSubscriptions() {
@ -109,7 +109,7 @@
function navToEditAudio() {
resetForm()
window.location = "#/account/audio"
window.location = "/client#/account/audio"
}
// handle update avatar event

View File

@ -74,7 +74,7 @@
function navToAccount() {
resetForm();
window.location = '#/account';
window.location = '/client#/account';
}
function handleUpdateEmail() {

View File

@ -38,7 +38,8 @@
last_name: userDetail.last_name,
user_instruments: userDetail.instruments,
birth_date : userDetail.birth_date,
gender: userDetail.gender
gender: userDetail.gender,
subscribe_email: userDetail.subscribe_email ? "checked=checked" : ""
});
var content_root = $('#account-profile-content-scroller')
@ -263,12 +264,12 @@
function navToAccount() {
resetForm();
window.location = '#/account';
window.location = '/client#/account';
}
function navToAvatar() {
resetForm();
window.location = '#/account/profile/avatar';
window.location = '/client#/account/profile/avatar';
}
function handleUpdateProfile() {
@ -280,11 +281,12 @@
var city = getCityElement().val();
var firstName = getFirstNameElement().val();
var lastName = getLastNameElement().val();
var gender = getGenderElement().val()
var gender = getGenderElement().val();
var subscribeEmail = getSubscribeEmail().is(':checked');
var birthDate = getBirthDate();
var instruments = getInstrumentsValue();
postUpdateProfile({
api.updateUser({
country: country,
state: region,
city: city,
@ -292,25 +294,13 @@
last_name: lastName,
gender: gender,
birth_date: birthDate,
instruments: instruments
instruments: instruments,
subscribe_email: subscribeEmail
})
.done(postUpdateProfileSuccess)
.fail(postUpdateProfileFailure)
}
function postUpdateProfile(options) {
var url = "/api/users/" + context.JK.currentUserId;
return $.ajax({
type: "POST",
dataType: "json",
contentType: 'application/json',
url: url,
data: JSON.stringify(options),
processData: false
});
}
function postUpdateProfileSuccess(response) {
app.notify(
{ title: "Profile Changed",
@ -332,6 +322,7 @@
var city = context.JK.format_errors("city", errors);
var birth_date = context.JK.format_errors("birth_date", errors);
var gender = context.JK.format_errors("birth_date", errors);
var subscribeEmail = context.JK.format_errors("subscribe_email", errors);
var instruments = context.JK.format_errors("musician_instruments", errors)
if(first_name != null) {
@ -358,6 +349,10 @@
getYearElement().closest('div.field').addClass('error').end().after(birth_date);
}
if(subscribeEmail != null) {
getSubscribeEmail().closest('div.field').addClass('error').end().after(subscribeEmail);
}
if(gender != null) {
getGenderElement().closest('div.field').addClass('error').end().after(gender);
}
@ -480,6 +475,10 @@
return $('#account-profile-content-scroller select#user_birth_date_1i');
}
function getSubscribeEmail() {
return $('#account-profile-content-scroller input[name=subscribe_email]');
}
function getInstrumentsElement() {
return $('#account-profile-content-scroller .instrument_selector');
}

View File

@ -139,7 +139,7 @@
function navToEditProfile() {
resetForm();
window.location = '#/account/profile'
window.location = '/client#/account/profile'
}
function renderAvatarSpinner() {

View File

@ -41,12 +41,14 @@
min-width: 165px;
width: 20%;
}
.account-left h2 {
color: #FFFFFF;
font-size: 23px;
font-weight: 400;
margin-bottom: 8px;
}
.account-mid {
float: left;
line-height: 150%;
@ -54,6 +56,29 @@
width: 50%;
}
.account-profile {
padding-top:25px;
h2 {
margin-bottom:15px;
}
.location {
position:relative;
}
#account-change-avatar {
position:absolute;
top:-25px;
right:80px;
height:13px;
}
.birth_date {
margin-left:40px;
}
}
.audio .audio-profiles-short{
white-space: normal;
}

View File

@ -342,7 +342,7 @@ ul.shortcuts {
.tagline {
font-size:30px;
margin-top:55px;
margin-top:35px;
color:#ed3718;
font-weight:300;
width:345px;

View File

@ -175,76 +175,3 @@ strong {
display:block;
}
}
// all custom CSS for the register page goes here
.register-page {
.register-container {
padding:10px;
}
input.register-musician {
}
.error {
padding: 5px 12px 5px 5px;
margin-left:-5px;
margin-right:-12px;
}
input.register-fan {
margin-left:20px;
}
input[type=text], input[type=password] {
margin-top:1px;
width:100%;
}
select {
width:100%;
}
.right-side {
margin-left:25px;
}
.ftue-left {
margin-bottom:30px;
select {
width:104%;
}
div.field {
margin-top:31px;
width:43%;
float:left;
}
}
.ftue-right {
table {
border-collapse:separate;
border-spacing:6px;
}
label.instruments {
margin-bottom:2px;
}
div.field {
margin-top:15px;
}
a.tos {
text-decoration: underline;
}
input[type=submit] {
margin-top:20px;
}
}
}

View File

@ -2,10 +2,9 @@
#footer-container {
position:relative;
width:1100px;
top:20px;
margin:0 6%;
top:100px;
height:13px;
}
#footer {

View File

@ -3,7 +3,6 @@ html {
}
body.web {
background-image: url(../web/bkg_home.gif);
background-repeat: repeat-x;
margin:0 !important;
padding:0 !important;
@ -12,26 +11,12 @@ body.web {
width:auto !important;
#web-container {
padding:3% 6%;
padding:3% 0;
}
div.wrapper {
width: 1100px;
margin: 0 auto;
white-space: nowrap;
}
.logo-home {
width: 298px;
margin-top: 30px;
display: inline-block;
float:left;
}
#profile {
margin-top: 25px;
}
#landing-inner {
p, ul {
color:#999;
line-height:160%;
@ -40,7 +25,153 @@ body.web {
white-space:normal;
font-size:16px;
}
h2 {
font-weight:300;
}
.content-wrapper {
border-bottom: medium none;
padding: 0;
}
.black-bar{
position:relative;
width:100%;
min-height: 366px;
background-color:black;
padding-top:20px;
}
.black-bar-inner {
width:1100px;
margin: 0 auto;
position:relative;
// all custom CSS for the register page goes here
.register-page {
.register-container {
padding:10px;
}
input.register-musician {
}
.actions {
margin-top:20px;
a.button-grey {
line-height:15px; // WHY is this not universal
}
}
.error {
padding: 5px 12px 5px 5px;
margin-left:-5px;
margin-right:-12px;
}
input.register-fan {
margin-left:20px;
}
input[type=text], input[type=password] {
margin-top:1px;
width:100%;
}
select {
width:100%;
}
.right-side {
margin-left:25px;
}
.register-left {
select {
width:104%;
}
div.field {
margin-top:31px;
width:43%;
float:left;
}
}
.register-right {
margin-top:40px;
table {
border-collapse:separate;
border-spacing:6px;
}
label.instruments {
margin-bottom:2px;
}
div.field {
margin-top:15px;
}
a.tos {
text-decoration: underline;
}
.ftue-instrumentlist {
width:100%;
}
}
}
}
.after-black-bar {
position:relative;
background-color:#262626;
width:1100px;
margin:0 auto;
.after-black-bar-inner {
background-color:#262626;
position:absolute;
left:0;
right:0;
}
}
}
.header {
width:1100px;
margin:0 auto;
.logo-home {
width: 298px;
margin-top: 30px;
display: inline-block;
float:left;
}
}
#profile {
position:absolute;
top:-80px;
right:0;
ul {
margin-bottom:0;
}
}
ul {
list-style: none outside none;
}
@ -62,7 +193,7 @@ body.web {
}
.system-requirements {
margin-top:75px;
margin-top:35px;
display:none;
ul {
@ -233,76 +364,3 @@ strong {
display:block;
}
}
// all custom CSS for the register page goes here
.register-page {
.register-container {
padding:10px;
}
input.register-musician {
}
.error {
padding: 5px 12px 5px 5px;
margin-left:-5px;
margin-right:-12px;
}
input.register-fan {
margin-left:20px;
}
input[type=text], input[type=password] {
margin-top:1px;
width:100%;
}
select {
width:100%;
}
.right-side {
margin-left:25px;
}
.ftue-left {
margin-bottom:30px;
select {
width:104%;
}
div.field {
margin-top:31px;
width:43%;
float:left;
}
}
.ftue-right {
table {
border-collapse:separate;
border-spacing:6px;
}
label.instruments {
margin-bottom:2px;
}
div.field {
margin-top:15px;
}
a.tos {
text-decoration: underline;
}
input[type=submit] {
margin-top:20px;
}
}
}

View File

@ -66,6 +66,7 @@ class ApiUsersController < ApiController
@user.musician = params[:musician] if params.has_key?(:musician)
@user.update_instruments(params[:instruments].nil? ? [] : params[:instruments]) if params.has_key?(:instruments)
@user.show_whats_next = params[:show_whats_next] if params.has_key?(:show_whats_next)
@user.subscribe_email = params[:subscribe_email] if params.has_key?(:subscribe_email)
@user.save

View File

@ -3,6 +3,14 @@ class ClientsController < ApplicationController
include UsersHelper
def index
# we want to enforce that /client is always the client view prefix
# this is a side effect of setting root path to '/'; soon we can remove this when we implement the new home page
if request.path == '/'
redirect_to client_url
return
end
# use gon to pass variables into javascript
gon.websocket_gateway_uri = Rails.application.config.websocket_gateway_uri
gon.check_for_client_updates = Rails.application.config.check_for_client_updates

View File

@ -22,6 +22,11 @@ class UsersController < ApplicationController
end
def new
if current_user
redirect_to :root
return
end
@invited_user = load_invited_user(params)
if !@invited_user.nil? && @invited_user.accepted
@ -41,10 +46,14 @@ class UsersController < ApplicationController
@user.email = @invited_user.email
end
render :layout => 'landing'
render :layout => 'web'
end
def create
if current_user
redirect_to :root
return
end
@invited_user = load_invited_user(params)
@signup_postback = load_postback(@invited_user)
@ -53,7 +62,7 @@ class UsersController < ApplicationController
# check recaptcha; if any errors seen, contribute it to the model
unless verify_recaptcha(:model => @user, :message => "recaptcha")
render 'new', :layout => 'landing'
render 'new', :layout => 'web'
return
end
@ -73,7 +82,6 @@ class UsersController < ApplicationController
params[:jam_ruby_user][:password],
params[:jam_ruby_user][:password_confirmation],
terms_of_service,
subscribe_email,
instruments,
birth_date,
location,
@ -88,7 +96,7 @@ class UsersController < ApplicationController
load_location(request.remote_ip, location)
gon.signup_errors = true
gon.musician_instruments = instruments
render 'new', :layout => 'landing'
render 'new', :layout => 'web'
else
sign_in @user

View File

@ -1,10 +1,10 @@
object @user
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :band_like_count, :follower_count, :following_count, :band_following_count, :recording_count, :session_count, :show_whats_next
attributes :id, :first_name, :last_name, :name, :city, :state, :country, :location, :online, :photo_url, :musician, :gender, :birth_date, :internet_service_provider, :friend_count, :liker_count, :like_count, :band_like_count, :follower_count, :following_count, :band_following_count, :recording_count, :session_count
# give back more info if the user being fetched is yourself
if @user == current_user
attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings
attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings, :show_whats_next, :subscribe_email
end
unless @user.friends.nil? || @user.friends.size == 0

View File

@ -22,100 +22,86 @@
<script type="text/template" id="template-account-profile">
<!-- content wrapper -->
<div class="content-wrapper account-profile">
<br />
<form id="account-edit-profile-form">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="33%"> <!-- TODO -->
<div class="right mr30"><!--<a href="#" class="avatar_large ml10"><img src="images/shared/avatar_jonathon.png" width="246" height="246" /></a>--><br clear="left" />
<a href="#" class="small" id="account-change-avatar">Change Avatar</a></div>
<h2>profile:</h2>
<h2>profile:</h2>
</td>
<div class="location w30 left">
<a href="#" class="small" id="account-change-avatar">Change Avatar</a>
<div class="field">
<label>Country:</label>
<select name='country' class="w80">
<option value='{country}' selected="selected">{country}</option>
</select>
</div>
<div class="field">
<label>State/Province:</label>
<select name='region' class="w80" disabled='disabled'>
<option value="{region}" selected="selected">{region}</option>
</select>
</div>
<div class="field">
<label>City:</label>
<select name='city' class="w80" disabled='disabled'>
<option value="{city}" selected="selected">{city}</option>
</select>
</div>
</div>
<div class="right-side right w70">
<div class="field left w45">
<label>First Name:</label>
<input type="text" name="first_name" value="{first_name}" class="w80"><br/>
</div>
<div class="field right w45">
<label>Last Name:</label>
<input type="text" name="last_name" value="{last_name}" class="w80">
</div>
<br class="clearall"/>
<div class="field left">
<label>Gender:</label>
<select name="gender" data-value="{gender}" class="w80">
<option value='M'>Male</option>
<option value='F'>Female</option>
<option>-</option>
</select>
</div>
<div class="field left birth_date">
<label>Birth Date:</label>
<%= date_select("user", "birth_date", :use_short_month => true, :start_year => 1900, :end_year => Time.now.year - 18, :order => [:month, :day, :year], :default => -25.years.from_now) %>
</div>
<br class="clearall"/>
<td valign="top" width="33%">
<div class="field">
First Name:<br />
<input type="text" name="first_name" value="{first_name}" class="w80"><br />
</div>
</td>
<td valign="top" width="33%">
<div class="field">
Last Name:<br />
<div class="field">
What instruments can you play?
<div class="profile-instrumentlist w90">
<table class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
<input type="text" name="last_name" value="{last_name}" class="w80">
</div>
</td>
</tr>
<tr>
<td valign="top">
<div class="field">
Country:<br />
<select name='country' class="w80"><option value='{country}' selected="selected">{country}</option></select><br /><br />
</div>
</td>
<td valign="top">
<div class="field">
Gender:<br />
<select name="gender" data-value="{gender}" class="w80"><option value='M'>Male</option><option value='F'>Female</option><option >-</option></select><br />
<br />
</div>
</td>
<td valign="top">
<div class="field">
Birth Date:<br />
<%= date_select("user", "birth_date", :use_short_month => true, :start_year => 1900, :end_year => Time.now.year - 18, :order => [:month, :day, :year], :default => -25.years.from_now ) %>
</div>
</td>
</tr>
<tr>
<td valign="top">
<div class="field">
State/Province:<br />
<select name='region' class="w80" disabled='disabled'><option value="{region}" selected="selected">{region}</option></select><br /><br />
</div>
</td>
<td rowspan=3 colspan=2 valign="top">
<div class="field">
What instruments can you play?
<div class="profile-instrumentlist w90">
<table class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
</table>
</div>
</div>
</td>
</tr>
<tr>
<td valign="top">
<div class="field">
City:<br />
<select name='city' class="w80" disabled='disabled'><option value="{city}" selected="selected">{city}</option></select><br /><br />
</div>
</td>
</tr>
</table>
</table>
</div>
</div>
<div class="field">
<input type="checkbox" name="subscribe_email" {subscribe_email} /> I will accept email from JamKazam about this service.
</div>
<div class="right actions">
<a id="account-edit-profile-cancel" href="#" class="button-grey">CANCEL</a>&nbsp;&nbsp;<a id="account-edit-profile-submit" href="#" class="button-orange">UPDATE PROFILE</a>
</div>
</div>
</form>
<br clear="all" />
<div class="right"><a id="account-edit-profile-cancel" href="#" class="button-grey">CANCEL</a>&nbsp;&nbsp;<a id="account-edit-profile-submit" href="#" class="button-orange">UPDATE PROFILE</a></div>
<br clear="all"/>
</div>
<!-- end content wrapper -->
@ -125,6 +111,10 @@
<script type="text/template" id="account-profile-instrument">
<tr data-instrument-id='{id}'>
<td><input type="checkbox" {checked} />{description}</td>
<td align="right" width="50%"><select name="proficiency" class='proficiency_selector'><option value="1">Beginner</option><option value="2">Intermediate</option><option value="3">Expert</option></select></td>
<td align="right" width="50%"><select name="proficiency" class='proficiency_selector'>
<option value="1">Beginner</option>
<option value="2">Intermediate</option>
<option value="3">Expert</option>
</select></td>
</tr>
</script>

View File

@ -21,55 +21,59 @@
<div id="web-container">
<div class="wrapper">
<div class="wrapper">
<div class="logo-home">
<%= link_to root_path do %>
<%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %>
<% end %>
</div>
<%= render "users/user_dropdown" %>
<br clear="all">
<div id="landing-inner">
<%= yield %>
</div>
<div id="footer-container">
<%= render "clients/footer" %>
</div>
</div>
<%= render "clients/invitationDialog" %>
<script type="text/javascript">
$(function () {
JK = JK || {};
<% if current_user %>
JK.currentUserId = '<%= current_user.id %>';
<% else %>
JK.currentUserId = null;
<div class="header">
<div class="logo-home">
<%= link_to root_path do %>
<%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %>
<% end %>
</div>
</div>
if (JK.currentUserId) {
JK.app = JK.JamKazam();
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter:false}});
<br clear="all">
var invitationDialog = new JK.InvitationDialog(JK.app);
invitationDialog.initialize();
<div class="black-bar">
<div class="black-bar-inner">
<%= render "users/user_dropdown" %>
<%= yield %>
</div>
</div>
var userDropdown = new JK.UserDropdown(JK.app);
userDropdown.initialize(invitationDialog);
}
})
</script>
<div class="after-black-bar">
<%= yield(:after_black_bar) %>
</div>
<div id="footer-container">
<%= render "clients/footer" %>
</div>
</div>
<%= render "clients/invitationDialog" %>
<script type="text/javascript">
$(function () {
JK = JK || {};
<% if current_user %>
JK.currentUserId = '<%= current_user.id %>';
<% else %>
JK.currentUserId = null;
<% end %>
if (JK.currentUserId) {
JK.app = JK.JamKazam();
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter: false}});
var invitationDialog = new JK.InvitationDialog(JK.app);
invitationDialog.initialize();
var userDropdown = new JK.UserDropdown(JK.app);
userDropdown.initialize(invitationDialog);
}
})
</script>
</div>

View File

@ -3,7 +3,7 @@
<div class="w100 ">
<div class="spinner-large"></div>
<div class="w70 left downloads-blurb">
<
</div>
</div>
@ -12,7 +12,7 @@
</div>
<br clear="all">
<% content_for :after_black_bar do %>
<div class="system-requirements w100">
<h3>SYSTEM REQUIREMENTS:</h3><br>
<p>A short summary of requirements follows. For a more detailed explanation of system requirements, please review our <a href="https://jamkazam.desk.com/customer/portal/articles/1288274-minimum-system-requirements">Minimum System Requirements</a> knowledgebase article.</p>
@ -22,14 +22,20 @@
<li>Ethernet port for Internet (we strongly advise that you not use Wi-Fi)</li>
<li>74MB hard disk space for app, plus any space needed for recordings</li>
<li>Audio interface (best to use an audio interface device that gets your music into your computer, else can use built-in mic &amp; headphones on your computer to get started)</li>
<li>Broadband Internet services with 1Mbps uplink bandwidth</li>
<li>Broadband Internet service with 1Mbps uplink bandwidth</li>
</ul>
<ul class="mac-requirements">
<li>Mac</li>
<li>Mac OS X 64-bit operating system 10.7 or higher</li>
<li>Dual-core processor or higher</li>
<li>Ethernet port for Internet (we strongly advise that you not use Wi-Fi)</li>
<li>74MB hard disk space for app, plus any space needed for recordings</li>
<li>Audio interface (best to use an audio interface device that gets your music into your computer, else can use built-in mic &amp; headphones on your computer to get started)</li>
<li>Broadband Internet service with 1Mbps uplink bandwidth</li>
</ul>
<ul class="linux-requirements">
<li>Linux is not yet supported</li>
</ul>
</div>
<%end%>
<%= render "users/download_templates" %>

View File

@ -13,12 +13,12 @@
<div class="arrow-down"></div>
<ul class="shortcuts">
<!-- <li><a layout-link="account">Profile</a></li> -->
<li class="account-home"><%= link_to "Account Home", '/client/#/account' %></li>
<li class="identity"><%= link_to "Identity", '/client/#/account/identity' %></li>
<li class="profile"><%= link_to "Profile", '/client/#/account/profile' %></li>
<!--<li class="subscriptions"><%= link_to "Subscriptions", '/client/#/account/subscriptions' %></li> -->
<!-- <li class="payments"><%= link_to "Payments", '/client/#/account/payments' %></li> -->
<li class="audio"><%= link_to "Audio Gear", '/client/#/account/audio' %></li>
<li class="account-home"><%= link_to "Account Home", '/client#/account' %></li>
<li class="identity"><%= link_to "Identity", '/client#/account/identity' %></li>
<li class="profile"><%= link_to "Profile", '/client#/account/profile' %></li>
<!--<li class="subscriptions"><%= link_to "Subscriptions", '/client#/account/subscriptions' %></li> -->
<!-- <li class="payments"><%= link_to "Payments", '/client#/account/payments' %></li> -->
<li class="audio"><%= link_to "Audio Gear", '/client#/account/audio' %></li>
<li class="invite-friends"><span class='menuheader'><span class="arrow-right"></span><%= link_to "Invite Friends", '#' %></span>
<ul class="shortcuts-submenu">
<li class="google-invite"><%= link_to "Google", '#' %></li>

View File

@ -1,152 +1,155 @@
<% provide(:title, 'Register') %>
<div class="signin-overlay register-page">
<div class="content-head">
<h1>create a jamkazam account</h1>
</div>
<div class="content-wrapper register-page">
<h2>Create a JamKazam account</h2>
<!-- inner wrapper -->
<div class="ftue-inner">
<%= form_for(@user, :url => @signup_postback) do |f| %>
<%= form_for(@user, :url => @signup_postback) do |f| %>
<!-- register left column -->
<div class="ftue-left">
<div class="register-container w100">
Register as a:
<%= f.radio_button :musician, true , :class=> "register-as register-musician"%>
Musician
<!-- register left column -->
<div class="register-left left w45">
<div class="register-container">
<div class="register-as">
Register as a:
<%= f.radio_button :musician, true, :class => "register-as register-musician" %>
Musician
<%= f.radio_button :musician, false, :class=> "register-as register-fan" %>
Fan
<%= f.radio_button :musician, false, :class => "register-as register-fan" %>
Fan
</div>
<div class="field first_name">
<%= f.label :first_name, "First Name:" %>
<%= f.text_field :first_name %>
</div>
<div class="field first_name">
<%= f.label :first_name, "First Name:" %>
<%= f.text_field :first_name %>
</div>
<div class="field last_name right-side">
<%= f.label :last_name, "Last Name:" %>
<%= f.text_field :last_name %>
</div>
<div class="field last_name right-side">
<%= f.label :last_name, "Last Name:" %>
<%= f.text_field :last_name %>
</div>
<br clear="all"/>
<br clear="all"/>
<div class="field email">
<%= f.label :email, "Email Address:" %>
<%= f.text_field :email %>
</div>
<div class="field email">
<%= f.label :email, "Email Address:" %>
<%= f.text_field :email %>
</div>
<div class="field country right-side">
<%= f.label :country, "Country:" %>
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off">
<option value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
<% @countries.each do |country| %>
<% unless country.blank? %>
<option value="<%= country %>" <%= @location[:country] == country ? "selected" : "" %>><%= country %></option>
<% end %>
<div class="field country right-side">
<%= f.label :country, "Country:" %>
<select id="country_select" name="jam_ruby_user[country]" autocomplete="off">
<option value="" <%= @location[:country].blank? ? "selected" : "" %>>Select Country</option>
<% @countries.each do |country| %>
<% unless country.blank? %>
<option value="<%= country %>" <%= @location[:country] == country ? "selected" : "" %>><%= country %></option>
<% end %>
</select>
</div>
<% end %>
</select>
</div>
<br clear="all"/>
<br clear="all"/>
<div class="field state">
<%= f.label :state, "State/Province:" %>
<select id="region_select" name="jam_ruby_user[state]" autocomplete="off">
<div class="field state">
<%= f.label :state, "State/Province:" %>
<select id="region_select" name="jam_ruby_user[state]" autocomplete="off">
<option value="" <%= @location[:state].blank? ? "selected" : "" %>>State/Province</option>
<% @regions.each do |region| %>
<% unless region.blank? %>
<option value="<%= region %>" <%= @location[:state] == region ? "selected" : "" %>><%= region %></option>
<option value="<%= region %>" <%= @location[:state] == region ? "selected" : "" %>><%= region %></option>
<% end %>
<% end %>
</select>
</div>
<div class="field city right-side">
<%= f.label :state, "City:" %>
<select id="city_select" name="jam_ruby_user[city]" autocomplete="off">
<option value="" <%= @location[:city].blank? ? "selected" : "" %>>Select City</option>
<% @cities.each do |city| %>
<% unless city.blank? %>
<option value="<%= city %>" <%= @location[:city] == city ? "selected" : "" %>><%= city %></option>
<% end %>
<% end %>
</select>
</div>
<br clear="all"/>
<div class="field password">
<%= f.label :password, "Choose a Password:" %>
<%= f.password_field :password%>
</div>
<div class="field password_confirmation right-side">
<%= f.label :password_confirmation, "Verify Password:" %>
<%= f.password_field :password_confirmation%>
</div>
<br clear="all"/>
</select>
</div>
<div class="field city right-side">
<%= f.label :state, "City:" %>
<select id="city_select" name="jam_ruby_user[city]" autocomplete="off">
<option value="" <%= @location[:city].blank? ? "selected" : "" %>>Select City</option>
<% @cities.each do |city| %>
<% unless city.blank? %>
<option value="<%= city %>" <%= @location[:city] == city ? "selected" : "" %>><%= city %></option>
<% end %>
<% end %>
</select>
</div>
<br clear="all"/>
<div class="field password">
<%= f.label :password, "Choose a Password:" %>
<%= f.password_field :password %>
</div>
<div class="field password_confirmation right-side">
<%= f.label :password_confirmation, "Verify Password:" %>
<%= f.password_field :password_confirmation %>
</div>
<br clear="all"/>
</div>
<!-- end left column -->
</div>
<!-- sign in right column -->
<div class="ftue-right"><br/>
<!-- sign in right column -->
<div class="register-right right w45"><br/>
<div class="ftue-instrumentlist-wrapper">
<label class="instruments">What instruments can you play?</label>
<div class="ftue-instrumentlist">
<table id="instrument_selector" class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
<% Instrument.standard_list.each do |instrument| %>
<tr>
<td><input id="<%= instrument.id.gsub(" ", "") %>_checkbox" name="jam_ruby_user[instruments][<%= instrument.id %>][selected]" type="checkbox" /><%= instrument.description %></td>
<td align="right" width="50%"><select id="<%= instrument.id.gsub(" ", "") %>_proficiency" name="jam_ruby_user[instruments][<%= instrument.id %>][proficiency]" class='proficiency_selector'><option value="1">Beginner</option><option value="2">Intermediate</option><option value="3">Expert</option></select></td>
</tr>
<% end %>
</table>
</div>
<div class="ftue-instrumentlist-wrapper">
<label class="instruments">What instruments can you play?</label>
<div class="ftue-instrumentlist">
<table id="instrument_selector" class="instrument_selector" width="100%" cellpadding="0" cellspacing="6">
<% Instrument.standard_list.each do |instrument| %>
<tr>
<td>
<input id="<%= instrument.id.gsub(" ", "") %>_checkbox" name="jam_ruby_user[instruments][<%= instrument.id %>][selected]" type="checkbox"/><%= instrument.description %>
</td>
<td align="right" width="50%">
<select id="<%= instrument.id.gsub(" ", "") %>_proficiency" name="jam_ruby_user[instruments][<%= instrument.id %>][proficiency]" class='proficiency_selector'>
<option value="1">Beginner</option>
<option value="2">Intermediate</option>
<option value="3">Expert</option>
</select></td>
</tr>
<% end %>
</table>
</div>
</div>
<div class="field subscribe_email">
<small>
<input id="jam_ruby_user_subscribe_email" name="jam_ruby_user[subscribe_email]" type="checkbox"/>
<span>I will accept email from JamKazam about this service.</span>
</small>
</div>
<div class="field terms_of_service">
<small>
<input id="jam_ruby_user_terms_of_service" name="jam_ruby_user[terms_of_service]" type="checkbox"/>
<span>I have read and agree to the JamKazam <%= link_to "terms of service", corp_terms_path , :rel=>"external" %>.</span>
</small>
</div>
<div class="field terms_of_service">
<small>
<input id="jam_ruby_user_terms_of_service" name="jam_ruby_user[terms_of_service]" type="checkbox"/>
<span>I have read and agree to the JamKazam <%= link_to "terms of service", corp_terms_path, :rel => "external" %>
.</span>
</small>
</div>
<% if Rails.application.config.recaptcha_enable %>
<%= recaptcha_tags %>
<% end %>
<% if Rails.application.config.recaptcha_enable %>
<%= recaptcha_tags %>
<% end %>
<!--
<img src="images/content/captcha.png" width="152" height="50" align="left" class="mr10" /><small>Enter the characters from the box to the left:<br />
<input type="text" /> <br clear="all" /><br />
-->
<!--
<img src="images/content/captcha.png" width="152" height="50" align="left" class="mr10" /><small>Enter the characters from the box to the left:<br />
<input type="text" /> <br clear="all" /><br />
-->
<%= f.submit "CREATE ACCOUNT", class: "right button-orange" %>
<br/ style="clear:both;"><br/>
<!--<a href="/auth/facebook" class="right"><img src="/fb-signup-button.png"></a> -->
<div class="actions">
<%= link_to "CANCEL", root_path, :class=>'button-grey left' %>
<%= f.submit "CREATE ACCOUNT", class: "right button-orange" %>
</div>
<br style="clear:both;"/><br/>
<!--<a href="/auth/facebook" class="right"><img src="/fb-signup-button.png"></a> -->
</div>
</div>
</div>
<!-- end right column -->
<!-- end right column -->
<% end %>
<br clear="all"/>
</div>
<!-- end inner -->
<% end %>
<!-- end overlay content -->
</div>
<!-- end inner -->
<!-- end overlay content -->
@ -157,7 +160,7 @@
window.signup.handle_register_as_changes()
function get_first_error(field) {
if(errors[field] && errors[field].length > 0) {
if (errors[field] && errors[field].length > 0) {
return errors[field][0]
}
else {
@ -166,16 +169,17 @@
}
// populate musician instruments from previous submit, if applicable
if(window.gon && gon.musician_instruments) {
$(gon.musician_instruments).each(function(index, value) {
if (window.gon && gon.musician_instruments) {
$(gon.musician_instruments).each(function (index, value) {
$('#' + value.instrument_id.replace(" ", "") + "_checkbox").attr("checked", true);
$('#' + value.instrument_id.replace(" ", "") + "_proficiency").val(value.proficiency_level.toString())
})
}
// show signup errors, if any
if(window.gon && gon.signup_errors) {
var errors = <%= @user.errors.to_json.html_safe %>
if (window.gon && gon.signup_errors) {
var errors =
<%= @user.errors.to_json.html_safe %>
var email = get_first_error("email")
var first_name = get_first_error("first_name")
@ -189,65 +193,65 @@
var city = get_first_error("city")
if(email) {
if (email) {
var emailInput = $('#jam_ruby_user_email');
emailInput.closest('div.field').addClass('error')
emailInput.after("<div class='error-text'>" + email + "</div>")
}
if(first_name) {
if (first_name) {
var firstNameInput = $('#jam_ruby_user_first_name');
firstNameInput.closest('div.field').addClass('error')
firstNameInput.after("<div class='error-text'>" + first_name + "</div>")
}
if(last_name) {
if (last_name) {
var lastNameInput = $('#jam_ruby_user_last_name');
lastNameInput.closest('div.field').addClass('error')
lastNameInput.after("<div class='error-text'>" + last_name + "</div>")
}
if(country) {
if (country) {
var countryInput = $('#country_select');
countryInput.closest('div.field').addClass('error')
countryInput.after("<div class='error-text'>" + country + "</div>")
}
if(state) {
if (state) {
var stateInput = $('#region_select');
stateInput.closest('div.field').addClass('error')
stateInput.after("<div class='error-text'>" + state + "</div>")
}
if(city) {
if (city) {
var cityInput = $('#city_select');
cityInput.closest('div.field').addClass('error')
cityInput.after("<div class='error-text'>" + city + "</div>")
}
if(musician_instruments) {
if (musician_instruments) {
var musicianInstrumentsInput = $('#instrument_selector');
musicianInstrumentsInput.closest('div.ftue-instrumentlist-wrapper').addClass('error')
musicianInstrumentsInput.closest('div.ftue-instrumentlist').after("<div class='error-text'>" + musician_instruments + "</div>")
}
if(password) {
if (password) {
var passwordInput = $('#jam_ruby_user_password');
passwordInput.closest('div.field').addClass('error')
passwordInput.after("<div class='error-text'>" + password+ "</div>")
passwordInput.after("<div class='error-text'>" + password + "</div>")
}
if(password_confirmation) {
if (password_confirmation) {
var passwordConfirmationInput = $('#jam_ruby_user_password_confirmation');
passwordConfirmationInput.closest('div.field').addClass('error')
passwordConfirmationInput.after("<div class='error-text'>" + password_confirmation + "</div>")
}
if(terms_of_service) {
if (terms_of_service) {
var termsOfServiceInput = $('#jam_ruby_user_terms_of_service');
termsOfServiceInput.closest('small').addClass('error')
// termsOfServiceInput.closest('small').after("<div class='error-text'>" + terms_of_service + "</div>")
// termsOfServiceInput.closest('small').after("<div class='error-text'>" + terms_of_service + "</div>")
}
}

View File

@ -10,7 +10,7 @@ class UserManager < BaseManager
# Note that almost everything can be nil here. This is because when users sign up via social media,
# we don't know much about them.
def signup(remote_ip, first_name, last_name, email, password = nil, password_confirmation = nil, terms_of_service = nil, subscribe_email = nil,
def signup(remote_ip, first_name, last_name, email, password = nil, password_confirmation = nil, terms_of_service = nil,
instruments = nil, birth_date = nil, location = nil, musician = nil, photo_url = nil, invited_user = nil, signup_confirm_url = nil)
@user = User.new
@ -33,7 +33,7 @@ class UserManager < BaseManager
# return @user # @user.errors.any? is true now
#else
# sends email to email account for confirmation
@user = User.signup(first_name, last_name, email, password, password_confirmation, terms_of_service, subscribe_email,
@user = User.signup(first_name, last_name, email, password, password_confirmation, terms_of_service,
location, instruments, birth_date, musician, photo_url, invited_user, signup_confirm_url)
return @user

View File

@ -14,6 +14,7 @@ FactoryGirl.define do
state "NC"
country "USA"
terms_of_service true
subscribe_email true
factory :admin do

View File

@ -15,7 +15,7 @@ describe "Account", :js => true, :type => :feature, :capybara_feature => true do
before(:each) do
UserMailer.deliveries.clear
sign_in_poltergeist user
visit "/#/account"
visit "/client#/account"
find('div.account-mid.identity')
end
@ -92,12 +92,18 @@ describe "Account", :js => true, :type => :feature, :capybara_feature => true do
before(:each) do
fill_in "first_name", with: "Bobby"
fill_in "last_name", with: "Toes"
find('input[name=subscribe_email]').set(false)
find("#account-edit-profile-submit").trigger(:click)
end
it {
user.subscribe_email.should be_true
should have_selector('h1', text: 'my account')
should have_selector('#notification h2', text: 'Profile Changed')
user.reload
user.subscribe_email.should be_false
user.first_name.should == "Bobby"
user.last_name.should == "Toes"
}
end

View File

@ -23,7 +23,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
MusicSession.delete_all
sign_in_poltergeist user
visit "/#/findSession"
visit "/client#/findSession"
# verify no sessions are found
expect(page).to have_selector('#sessions-none-found')
@ -38,7 +38,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
in_client(:one) do
page.driver.resize(1500, 600) # crude hack
sign_in_poltergeist user
visit "/#/createSession"
visit "/client#/createSession"
within('#create-session-form') do
fill_in('description', :with => @unique_session_desc)
@ -54,7 +54,7 @@ describe "Find Session", :js => true, :type => :feature, :capybara_feature => tr
# find session in second client
in_client(:two) do
sign_in_poltergeist finder
visit "/#/findSession"
visit "/client#/findSession"
# verify the session description is seen by second client
expect(page).to have_text(@unique_session_desc)

View File

@ -12,7 +12,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
describe "signup page" do
before { visit signup_path }
it { should have_selector('h1', text: 'create a jamkazam account') }
it { should have_selector('h2', text: 'Create a JamKazam account') }
describe "with valid musician information" do
before do
@ -147,6 +147,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
click_button "CREATE ACCOUNT"
page.should have_title("JamKazam")
should have_selector('div.tagline', text: "Congratulations!")
sign_out
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
end
@ -180,6 +181,7 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
UserMailer.deliveries.length.should == 1
uri = URI.parse(current_url)
"#{uri.path}?#{uri.query}".should == congratulations_musician_path(:type => 'Native')
sign_out
visit "#{signup_path}?invitation_code=#{@invited_user.invitation_code}"
should have_selector('h1', text: "You have already signed up with this invitation")
}

View File

@ -73,7 +73,7 @@ describe "User Progression", :js => true, :type => :feature, :capybara_feature
describe "certified gear" do
before(:each) do
sign_in_poltergeist user
visit '/#/account/audio'
visit '/client#/account/audio'
find("div.account-audio a[data-purpose='add-profile']").trigger(:click)
find("a[layout-wizard-link='2']").trigger(:click) # NEXT
find("a[layout-wizard-link='3']").trigger(:click) # NEXT

View File

@ -15,7 +15,7 @@ describe UserManager do
MaxMindIsp.delete_all # prove that city/state/country will remain nil if no maxmind data
MaxMindGeo.delete_all
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman1@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman1@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.first_name.should == "bob"
@ -26,13 +26,14 @@ describe UserManager do
@user.state.should be_nil
@user.country.should be_nil
@user.instruments.length.should == 1
@user.subscribe_email.should be_true
@user.signup_token.should_not be_nil
UserMailer.deliveries.length.should == 1
end
it "signup successfully with instruments" do
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman2@jamkazam.com", "foobar", "foobar", true, nil,
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman2@jamkazam.com", "foobar", "foobar", true,
@instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
@user.errors.any?.should be_false
@ -43,7 +44,7 @@ describe UserManager do
end
it "doesnt fail if ip address is nil" do
@user = @user_manager.signup(nil, "bob", "smith", "userman3@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup(nil, "bob", "smith", "userman3@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.city.should be_nil
@ -55,7 +56,7 @@ describe UserManager do
MaxMindManager.active_record_transaction do |manager|
manager.create_phony_database()
end
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman4@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman4@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.city.should == 'City 127'
@ -67,7 +68,7 @@ describe UserManager do
MaxMindManager.active_record_transaction do |manager|
manager.create_phony_database()
end
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman5@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, @location, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman5@jamkazam.com", "foobar", "foobar", true, @instruments, nil, @location, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.city.should == 'Little Rock'
@ -79,7 +80,7 @@ describe UserManager do
MaxMindManager.active_record_transaction do |manager|
manager.create_phony_database()
end
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman6@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, {}, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman6@jamkazam.com", "foobar", "foobar", true, @instruments, nil, {}, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.city.should be_nil
@ -92,7 +93,7 @@ describe UserManager do
MaxMindManager.active_record_transaction do |manager|
manager.create_phony_database()
end
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman7@jamkazam.com", "foobar", "foobar", true, nil, @instruments, Date.new(2001, 1, 1), nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman7@jamkazam.com", "foobar", "foobar", true, @instruments, Date.new(2001, 1, 1), nil, true, nil, nil, "http://localhost:3000/confirm" )
@user.errors.any?.should be_false
@user.birth_date.should == Date.new(2001, 1, 1)
@ -100,26 +101,26 @@ describe UserManager do
it "duplicate signup failure" do
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
UserMailer.deliveries.length.should == 1
@user.errors.any?.should be_false
# exactly the same parameters; should dup on email, and send no email
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman8@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
UserMailer.deliveries.length.should == 1
@user.errors.any?.should be_true
@user.errors[:email][0].should == "has already been taken"
end
it "fail on no username" do
@user = @user_manager.signup("127.0.0.1", "", "", "userman10@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
@user = @user_manager.signup("127.0.0.1", "", "", "userman10@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm")
UserMailer.deliveries.length.should == 0
@user.errors.any?.should be_true
@user.errors[:first_name][0].should == "can't be blank"
end
it "fail on no email" do
@user = @user_manager.signup("127.0.0.1", "murp", "blurp", "", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "murp", "blurp", "", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
UserMailer.deliveries.length.should == 0
@user.errors.any?.should be_true
@user.errors[:email][0].should == "can't be blank"
@ -129,7 +130,7 @@ describe UserManager do
describe "signup_confirm" do
it "fail on no username" do
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman11@jamkazam.com", "foobar", "foobar", true, nil, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman11@jamkazam.com", "foobar", "foobar", true, @instruments, nil, nil, true, nil, nil, "http://localhost:3000/confirm" )
@user = @user_manager.signup_confirm(@user.signup_token)
@user.email_confirmed.should be_true
end
@ -155,7 +156,7 @@ describe UserManager do
@invitation.accepted.should be_false
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
@user.errors.any?.should be_false
@ -175,7 +176,7 @@ describe UserManager do
UserMailer.deliveries.clear
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
@user.errors.any?.should be_false
@ -195,7 +196,7 @@ describe UserManager do
UserMailer.deliveries.clear
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true, nil,
@user = @user_manager.signup("127.0.0.1", "bob", "smith", @invitation.email, "foobar", "foobar", true,
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
@user.errors.any?.should be_false
@ -217,7 +218,7 @@ describe UserManager do
UserMailer.deliveries.clear
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman12@jamkazam.com", "foobar", "foobar", true, nil,
@user = @user_manager.signup("127.0.0.1", "bob", "smith", "userman12@jamkazam.com", "foobar", "foobar", true,
@instruments, nil, nil, true, nil, @invitation, "http://localhost:3000/confirm")
@user.errors.any?.should be_false

View File

@ -35,6 +35,14 @@ def sign_in_poltergeist(user)
end
end
def sign_out()
if Capybara.javascript_driver == :poltergeist
page.driver.remove_cookie(:remember_token)
else
page.driver.browser.manage.remove_cookie :name => :remember_token
end
end
def wait_for_ajax(wait=Capybara.default_wait_time)
wait = wait * 10 #(because we sleep .1)