This file contains hidden or 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 Link | |
constructor: -> | |
$(document).ready -> | |
@registerHandlers() | |
registerHandlers: -> | |
linksActive = no | |
$('.activate-links').on 'click', => | |
if linksActive |
This file contains hidden or 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
require 'benchmark' | |
def require(file) | |
puts Benchmark.measure("") { | |
super | |
}.format("%t require #{file}") | |
end |
This file contains hidden or 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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains hidden or 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
=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') |
This file contains hidden or 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
def generate_product(product = nil, product_type = nil, s3_bucket) | |
sFramePath = layers_path + "displace/" | |
b_lampshade = false | |
if File.directory? sFramePath | |
b_lampshade = true |
This file contains hidden or 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
def calculate_stretchable_sizes() | |
if @centralized | |
@left_middle_height_1 = ((@left_middle_height-@center_height)/2).to_i | |
@left_middle_height_2 = @left_middle_height-(@left_middle_height_1+@center_height) | |
@right_middle_height_1 = ((@right_middle_height-@center_height)/2).to_i | |
@right_middle_height_2 = @right_middle_height-(@right_middle_height_1+@center_height) | |
end | |
if @centralized | |
if @left_middle.nil? and @left_width > 0 and @left_middle_height_1 > 0 and @left_middle_height_2 > 0 |