start new:
tmux
start new with session name:
tmux new -s myname
shared_examples_for "driver with javascript support" do | |
before { @driver.visit('/with_js') } | |
describe '#find' do | |
it "should find dynamically changed nodes" do | |
@driver.find('//p').first.text.should == 'I changed it' | |
end | |
end | |
describe '#drag_to' do |
NOTE: I've created a gem based on this: https://github.com/natritmeyer/yarjuf | |
--------- | |
rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml |
# It extends activeadmin to show pretty boolean values | |
# | |
# config/initializers/active_admin.rb | |
module ActiveAdmin | |
module Views | |
class TableFor | |
def bool_column(attribute) | |
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
end |
;; eg when in a text file, (execute-shell-command-on-buffer "p4 edit %s") will check out the file in perforce | |
(defun execute-shell-command-on-buffer (shell-command-text) | |
(interactive "MShell command:") | |
(shell-command (format shell-command-text (shell-quote-argument buffer-file-name))) | |
) |
def select_from_chosen(item_text, options) | |
field_id = find_field(options[:from])[:id] | |
within "##{field_id}_chzn" do | |
find('a.chzn-single').click | |
input = find("div.chzn-search input") | |
item_text.each_char do |char| | |
input.base.invoke('keypress', false, false, false, false, char.ord, nil); | |
end | |
find('ul.chzn-results').click | |
input.base.invoke('keypress', false, false, false, false, 40, nil); # down arrow |
en: | |
errors: | |
messages: | |
wrong_content_type: "is the wrong content type" |
# (v.respond_to?(:empty?) ? v.empty? : !v) is basically rails' .blank? in plain ruby | |
class Hash | |
def delete_blank | |
delete_if do |k, v| | |
(v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && v.delete_blank.empty? | |
end | |
end | |
end |
#!/bin/bash | |
# | |
# app Rails application served through an Unicorn instance | |
# | |
# Author Romain Champourlier @ softr.li | |
# | |
# chkconfig: - 87 13 | |
# | |
# description: This a web application developed in Ruby On Rails | |
# which is served through an Unicorn instance. |