* tweak hover code
This commit is contained in:
parent
5e62890003
commit
83038cf315
|
|
@ -0,0 +1,9 @@
|
||||||
|
class ExtrasController < ApplicationController
|
||||||
|
|
||||||
|
before_filter :signed_in_user
|
||||||
|
before_filter :admin_user
|
||||||
|
|
||||||
|
def settings
|
||||||
|
render layout: "web"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
%h1 Extra Feature Settings
|
||||||
|
|
||||||
|
%form
|
||||||
|
%button.launch_new_ftue{type: 'button'}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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..."
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue