* VRFS-711 welcome email added; also, VRFS-725 fixing signout
This commit is contained in:
parent
f9f012cdc8
commit
b40e240cd4
|
|
@ -55,10 +55,8 @@ describe UserMailer do
|
|||
it { mail.multipart?.should == true } # because we send plain + html
|
||||
|
||||
# verify that the messages are correctly configured
|
||||
it { mail.html_part.body.include?("Welcome").should be_true }
|
||||
it { mail.html_part.body.include?(signup_confirmation_url_with_token).should be_true }
|
||||
it { mail.text_part.body.include?("Welcome").should be_true }
|
||||
it { mail.text_part.body.include?(signup_confirmation_url_with_token).should be_true }
|
||||
it { mail.html_part.body.include?("delighted").should be_true }
|
||||
it { mail.text_part.body.include?("delighted").should be_true }
|
||||
end
|
||||
|
||||
describe "should send reset password" do
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
var instrumentNames = [];
|
||||
var instrumentPopularities = {}; // id -> popularity
|
||||
var invitationDialog = new context.JK.InvitationDialog(app);
|
||||
var rest = new JK.Rest();
|
||||
|
||||
function loadInstruments() {
|
||||
// TODO: This won't work in the long-term. We'll need to provide
|
||||
|
|
@ -99,7 +100,6 @@
|
|||
|
||||
$('.userinfo').on('click', function() {
|
||||
$('ul.shortcuts', this).toggle();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.userinfo .invite-friends .menuheader').on('click', function(e) {
|
||||
|
|
@ -108,6 +108,17 @@
|
|||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
$('.userinfo .sign-out a').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
/** rest.signout()
|
||||
.done(function() {
|
||||
|
||||
})
|
||||
|
||||
}); */
|
||||
|
||||
$('.invite-friends .google-invite a').on('click', function(e) {
|
||||
invitationDialog.showGoogleDialog();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -190,6 +190,15 @@
|
|||
});
|
||||
}
|
||||
|
||||
function signout() {
|
||||
return $.ajax({
|
||||
type: "DELETE",
|
||||
dataType: "json",
|
||||
url: '/signout',
|
||||
contentType: 'application/json'
|
||||
});
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
return self;
|
||||
}
|
||||
|
|
@ -211,6 +220,7 @@
|
|||
this.createInvitation = createInvitation;
|
||||
this.postFeedback = postFeedback;
|
||||
this.serverHealthCheck = serverHealthCheck;
|
||||
this.signout = signout;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Authentication" do
|
||||
describe "Authentication", :js => true, :type => :feature, :capybara_feature => true do
|
||||
|
||||
subject { page }
|
||||
|
||||
before(:all) do
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.current_driver = Capybara.javascript_driver
|
||||
Capybara.default_wait_time = 10
|
||||
end
|
||||
|
||||
describe "signin page" do
|
||||
before { visit signin_path }
|
||||
|
||||
|
|
@ -25,6 +31,7 @@ describe "Authentication" do
|
|||
#it { should_not have_selector('div.alert.alert-error') }
|
||||
#end
|
||||
end
|
||||
|
||||
|
||||
describe "with valid information" do
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
|
@ -36,7 +43,21 @@ describe "Authentication" do
|
|||
|
||||
# Successful sign-in goes to the client
|
||||
it { page.should have_title("JamKazam") }
|
||||
it { should have_selector('h1', text: "audio gear setup") }
|
||||
it { should have_selector('h2', text: "musicians") }
|
||||
|
||||
describe "signout" do
|
||||
|
||||
before(:each) do
|
||||
|
||||
should have_selector('h2', text: "musicians")
|
||||
# open menu
|
||||
find('.userinfo').trigger(:click)
|
||||
# click signout link
|
||||
find('.userinfo .sign-out a').trigger(:click)
|
||||
|
||||
end
|
||||
it { page.should have_title("JamKazam | Sign in") }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -70,7 +91,7 @@ describe "Authentication" do
|
|||
it "should render the signed-in client page" do
|
||||
# it now goes to /music_sessions
|
||||
page.should have_title("JamKazam")
|
||||
page.should have_selector('h1', text: "audio gear setup")
|
||||
page.should have_selector('h2', text: "musicians")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -93,7 +114,7 @@ describe "Authentication" do
|
|||
describe "as wrong user" do
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
let(:wrong_user) { FactoryGirl.create(:user, email: "wrong@example.com") }
|
||||
before { sign_in user }
|
||||
before { sign_in_poltergeist user }
|
||||
|
||||
describe "visiting Users#edit page" do
|
||||
before { visit edit_user_path(wrong_user) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue