This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::API | |
def status | |
begin | |
DatabaseHelper::Mysql.smrt.exec_query('SELECT id FROM customers LIMIT 1') | |
DatabaseHelper::Mysql.scr.exec_query('SELECT id FROM filter_prefixes LIMIT 1') | |
DatabaseHelper::Mysql.backend.exec_query('SELECT id FROM accounts LIMIT 1') | |
DatabaseHelper::Mysql.delayed_job.exec_query('SELECT id FROM delayed_jobs LIMIT 1') | |
status = Class.new.extend DatabaseHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Add this to your application_controller | |
def self.authorized_inherited_resources | |
inherit_resources | |
before_filter :authorize_resource_with_cancan | |
define_method(:authorize_resource_with_cancan) do | |
case action_name.to_sym | |
when :new, :create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: | |
# chosen_select 'select[name="projects"]', "ProjectA" | |
# | |
def chosen_select (css_select, option_text) | |
element_id = page.find(css_select)['id'] | |
page.driver.browser.mouse.down find("##{element_id}_chzn").native | |
within("##{element_id}_chzn") do | |
find(:xpath,"//li[text()=\"#{option_text}\"]").click | |
end |