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
| UIImageView* icon = [[UIImageView alloc] initWithImage:iconImage]; | |
| CGRect cellRect = cell.bounds; | |
| CGRect iconRect = CGRectMake(cellRect.size.width - icon.bounds.size.width, | |
| (int)((cellRect.size.height - icon.bounds.size.height)/2), | |
| icon.bounds.size.width, icon.bounds.size.height); | |
| icon.frame = iconRect; | |
| [cell addSubview:icon]; |
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
| #import <SenTestingKit/SenTestingKit.h> | |
| #import "OCMock/OCMock.h" | |
| #import "AccountController.h" | |
| @interface AccountControllerTest : SenTestCase { | |
| id mockRebtelSvc; | |
| AccountController *sut; | |
| } | |
| - (void) executeSignupSuccessBlock; |
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
| // Fibonacci | |
| fib := method(nth, | |
| if(nth < 3, 1, | |
| if(nth == 3, | |
| 2, | |
| fib(nth-2) + fib(nth-1) | |
| ) | |
| ) | |
| ) |
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 File.dirname(__FILE__) + '/../spec_helper' | |
| require @root_dir + "/controllers/request_properties" | |
| class RequestPropertiesExampleGroup | |
| extend Spec::Example::ExampleGroupMethods | |
| include Spec::Example::ExampleMethods | |
| def self.instance_with_uri(uri, &block) | |
| context "with URI '#{uri}'" do |
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 File.dirname(__FILE__) + '/../spec_helper' | |
| require @root_dir + "/controllers/request_properties" | |
| module Adserver; module Controller | |
| module RequestPropertiesSpecDSL | |
| def instance_with_uri(uri, &block) | |
| context "with URI '#{uri}'" do | |
| before do | |
| request = stub(:env => {'REQUEST_URI' => uri } ) |
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 | |
| class Item < ActiveRecord::Base | |
| acts_as_nested_set | |
| 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
| # added to the end of environments/test.rb | |
| config.after_initialize do | |
| if SeleniumOnRailsConfig.get(:environments).include? RAILS_ENV | |
| class SeleniumOnRails::RSelenese | |
| class_eval do | |
| include Selenium::DSL | |
| end | |
| end | |
| end | |
| 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
| # lib/selenium/dsl.rb | |
| module Selenium | |
| module DSL | |
| def login(name, password) | |
| open '/' | |
| type "login", name | |
| type "password", password | |
| click "loginSubmit" |
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
| include_partial "login", :name => "quentin", :password => "test" |
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
| open '/' | |
| type "login", name | |
| type "password", password | |
| click "loginSubmit" | |
| wait_for_text "flashNotice", "Logged in successfully" |
NewerOlder