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
| context "GET :index" do | |
| setup { get '/' } | |
| asserts(:body).matches %r{hello world} | |
| asserts(:status).equals 200 | |
| context "changing stuff" do | |
| hookup { Something.create :stuff => 'this' } | |
| asserts(:body).matches %r{this} |
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 Riot::Context | |
| # Test Helper to check if route needs authentication | |
| # | |
| # asserts_must_authenticate { post '/photos/new' } | |
| # | |
| def asserts_must_authenticate(&block) | |
| context "without being authenticated" do | |
| setup(&block) | |
| setup { follow_redirect! } |
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
| MyApp.helpers do | |
| include MyHelperModule | |
| 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
| Admin.controllers :website, :navigation_items do | |
| # /navigation/:navigation_id/website/navigation_items | |
| get :index, :parent => :navigation do | |
| 'bleh' | |
| 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
| require 'resque/tasks' | |
| namespace :resque do | |
| desc "Load the Application Development for Resque" | |
| task :setup => :environment do | |
| ENV['QUEUE'] = '*' | |
| # ENV['VERBOSE'] = '1' # Verbose Logging | |
| 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
| # ree-1.8.7-2011.03 | |
| user system total real | |
| #stat 0.020000 0.010000 0.030000 ( 0.022279) | |
| #mtime 0.050000 0.040000 0.090000 ( 0.087421) | |
| # ruby-1.9.2-p180 | |
| user system total real | |
| #stat 0.020000 0.000000 0.020000 ( 0.017624) |
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
| --- | |
| :mock: rr | |
| :script: jquery | |
| :test: riot | |
| :orm: mongoid | |
| :stylesheet: scss | |
| :renderer: haml |
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.expand_path(File.dirname(__FILE__) + '/../../test_config.rb') | |
| context "PagesController" do | |
| context "GET :index" do | |
| setup { get '/pages' } | |
| # These two are the same | |
| asserts_body.matches %r{Something} # My custom helper | |
| asserts("that it shows something") { last_response.body }.matches %r{Something} |
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.expand_path(File.dirname(__FILE__) + '/../test_config.rb') | |
| describe "MainController" do | |
| it 'returns text at root' do | |
| get "/" | |
| last_response.body.should == "main app" | |
| 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
| require 'sinatra' | |
| require 'padrino-helpers' | |
| helpers Padrino::Helpers | |
| get "/" do | |
| "Click my link: #{link_to 'here', '#'}" | |
| end |