This file contains 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
GIT | |
remote: git://github.com/gregbell/active_admin.git | |
revision: 18438fcc82ef12f74d43f65766125eac466f79fc | |
ref: 18438fcc82ef12f74d43f65766125eac466f79fc | |
specs: | |
activeadmin (0.5.0) | |
arbre (>= 1.0.1) | |
bourbon (>= 1.0.0) | |
devise (>= 1.1.2) | |
fastercsv |
This file contains 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
Webpage error details | |
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) | |
Timestamp: Wed, 13 Nov 2013 18:25:07 UTC | |
Message: Object doesn't support this property or method | |
Line: 4 | |
Char: 6105 | |
Code: 0 |
This file contains 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 NutritionData < ActiveRecord::Base | |
attr_accessible :calories, :calories_from_fat, :header, :item_id, :serving, :nutrition_items_attributes | |
validates :calories, :presence => true, :numericality => true | |
validates :calories_from_fat, :presence => true, :numericality => true | |
validates :header, :presence => true | |
validates :serving, :presence => true | |
belongs_to :item |
This file contains 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
A method stub | |
ignores when expected message is received with no args | |
allows a stub and an expectation | |
instructs an instance to respond_to the message | |
calculates return value by executing block passed to #and_return | |
handles multiple stubbed methods | |
ignores when expected message is not received | |
instructs a class object to respond_to the message | |
overrides a pre-existing method | |
keeps returning last value in consecutive calls |
This file contains 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
#with rspec | |
payment.should be_cancelled |
This file contains 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
#bad example | |
assert_equal 4, payment.code | |
#good example | |
assert_equal Payment::Status::CANCELLED, payment.code |
This file contains 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 "context of a small business scenario" | |
should "exact business requirement" do | |
<on doing this> | |
<this happens> | |
end | |
end |
This file contains 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 'spec_helper' | |
class DummyApplicationController < ApplicationController | |
before_filter :require_authentication, :only => :authenticated_resource | |
before_filter :check_if_self, :only => :dummy_method_to_test_check_for_self | |
def get_action | |
render :nothing => true | |
end | |
def authenticated_resource |
This file contains 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 AppAuthHeaders | |
cattr_accessor :remember_token | |
def self.headers | |
remember_token.blank? ? {"Authorization" => ""} : {"Authorization" => "RememberToken #{self.remember_token}"} | |
end | |
end |
This file contains 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 BuildPostProcessor | |
def notify_on_failure(&block) | |
on_failure_notifier = BuildNotification.new | |
@build_statuses[:failure] << [block, on_failure_notifier] | |
end | |
def on_success_build_artifacts(artifacts_builder) | |
@build_statuses[:success] << artifacts_builder.new | |
yield(artifacts_builder.new) | |
end |
NewerOlder