=Navigating= visit('/projects') visit(post_comments_path(post))
=Clicking links and buttons= click_link('id-of-link') click_link('Link Text') click_button('Save') click('Link Text') # Click either a link or a button click('Button Value')
/** | |
* jQuery Masonry v2.1.01 | |
* A dynamic layout plugin for jQuery | |
* The flip-side of CSS Floats | |
* http://masonry.desandro.com | |
* | |
* Licensed under the MIT license. | |
* Copyright 2011 David DeSandro | |
*/ | |
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
require 'active_support/core_ext' | |
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch(%r{^config/environments/.+\.rb$}) | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('Gemfile') |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: sidekiq beta | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: sidekiq beta - asynchronous rails |
english_group_id = LanguageCountry.joins(:language).where("language = 'English'").pluck(:group_id).uniq.first | |
hindi_group_id = LanguageCountry.joins(:language).where("language = 'Hindi'").pluck(:group_id).uniq.first | |
def write_csv(name, movies) | |
path = "#{Rails.root.to_s}/log/#{name}.csv" | |
CSV.open(path, "a+") do |csv| | |
csv << [] | |
movies.each do |movie| | |
csv << [movie[:release_year], movie[:engtitle], movie[:cached_avg_rating], movie[:cached_times_rated]] | |
end |
specify { (0.6*2).should be_within(0.01).of(1.2) } |
=Navigating= visit('/projects') visit(post_comments_path(post))
=Clicking links and buttons= click_link('id-of-link') click_link('Link Text') click_button('Save') click('Link Text') # Click either a link or a button click('Button Value')
module SphinxHelpers | |
def index | |
ThinkingSphinx::Test.index | |
# Wait for Sphinx to finish loading in the new index files. | |
sleep 0.25 until index_finished? | |
end | |
def index_finished? | |
Dir[Rails.root.join(ThinkingSphinx::Test.config.searchd_file_path, '*.{new,tmp}.*')].empty? | |
end |
.container { | |
padding: 10px; | |
background-color: #ADD8E6; | |
width: 150px; | |
} | |
.box-holder { | |
width: 50px; | |
height: 50px; | |
background-color: #EEE; |
/** | |
* Image with Username | |
*/ | |
@import url('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css'); | |
#container { | |
margin-top: 60px; | |
} |