* tweak hover code

This commit is contained in:
Seth Call 2014-04-11 14:45:54 +00:00
parent 5e62890003
commit 83038cf315
7 changed files with 38 additions and 7 deletions

View File

@ -0,0 +1,9 @@
class ExtrasController < ApplicationController
before_filter :signed_in_user
before_filter :admin_user
def settings
render layout: "web"
end
end

View File

@ -396,10 +396,6 @@ class UsersController < ApplicationController
redirect_to(root_url) unless current_user?(@user) redirect_to(root_url) unless current_user?(@user)
end end
def admin_user
redirect_to(root_url) unless current_user.admin?
end
# the User Model expects instruments in a different format than the form submits it # the User Model expects instruments in a different format than the form submits it
# so we have to fix it up. # so we have to fix it up.
def fixup_instruments(original_instruments) def fixup_instruments(original_instruments)

View File

@ -57,6 +57,10 @@ module SessionsHelper
cookies.delete(:remember_token, domain: Rails.application.config.session_cookie_domain) cookies.delete(:remember_token, domain: Rails.application.config.session_cookie_domain)
end end
def admin_user
redirect_to(root_url) unless current_user.admin?
end
def redirect_back_or(default) def redirect_back_or(default)
redirect_to(session[:return_to] || default) redirect_to(session[:return_to] || default)
session.delete(:return_to) session.delete(:return_to)

View File

@ -0,0 +1,6 @@
%h1 Extra Feature Settings
%form
%button.launch_new_ftue{type: 'button'}

View File

@ -98,6 +98,8 @@ SampleApp::Application.routes.draw do
# vanilla forums sso # vanilla forums sso
match '/forums/sso', to: 'vanilla_forums#authenticate' match '/forums/sso', to: 'vanilla_forums#authenticate'
# admin-only page to control settings
match '/extras/settings', to: 'extras#settings'
scope '/corp' do scope '/corp' do
# about routes # about routes

View File

@ -51,7 +51,12 @@ tests_started = false
Thread.new { Thread.new {
sleep 240 if ENV['BUILD_NUMBER']
sleep 240
else
sleep 30
end
unless tests_started unless tests_started
bputs "tests are hung. exiting..." bputs "tests are hung. exiting..."
puts "tests are hung. exiting..." puts "tests are hung. exiting..."

View File

@ -4,10 +4,19 @@ include ApplicationHelper
module Capybara module Capybara
module Node module Node
class Element class Element
def attempt_hover
begin
hover
rescue => e
end
end
def hover_intent def hover_intent
hover hover
hover sleep 0.3
hover attempt_hover
sleep 0.3
attempt_hover
end end
end end
end end