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
module AuthenticationSpecHelper | |
def current_user(user=nil) | |
@current_user ||= Factory(:user) | |
end | |
def user_session(stubs = {}, user=nil) | |
@current_user_session ||= mock_model(UserSession, {:user => current_user(user)}) | |
end | |
def login(session_stubs = {}, user=nil) |
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
# mine | |
@user_questions = UserQuestion.by_clinic_id(@clinic.id).by_user_id(current_user.id). | |
ordered | |
# yours | |
@user_questions = UserQuestion.where("question_id IN (?)", question_ids) |
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
rake spec:models | |
(in /Users/james/development/clients/blanee) | |
./spec/models/../../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement | |
WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.7.3 | |
loading categories and citis | |
load finished | |
Mocha deprecation warning: Mocha::Standalone has been renamed to Mocha::API | |
......................................Ftrue | |
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
1) | |
'AccountController AccountController should be able to upload avatar' FAILED | |
expected: 1, | |
got: 0 (using ==) | |
./spec/controllers/account_controller_spec.rb:144: | |
2) | |
'Pic pic should be valid when files are png or gif' FAILED | |
expected valid_on_create? to return true, got false | |
./spec/models/pic_spec.rb:18: |
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
WorkOrder | |
adding cost codes | |
should not have a cost code (FAILED - 1) | |
should allow you to add a cost code (FAILED - 2) | |
should have one field cost code (FAILED - 3) | |
should have one engineering cost code (FAILED - 4) | |
has 100 hours of Field labor (FAILED - 5) | |
has 100 hours of Engineering labor (FAILED - 6) | |
will update the total field labor on save (FAILED - 7) | |
will update the total engineering labor on save (FAILED - 8) |
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 Array | |
def to_hash | |
begin | |
raise ArgumentError if self.collect {|x| x.flatten.size > 2}.reject {|x| x == false}.size > 0 | |
Hash[*self.flatten] | |
rescue NoMethodError | |
raise ArgumentError | |
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
From cfbcb70ab0a17ed97355166b4cfcab3a9f323d67 Mon Sep 17 00:00:00 2001 | |
From: James OKelly <[email protected]> | |
Date: Sun, 28 Nov 2010 21:51:59 -0800 | |
Subject: [PATCH] fixed two failing json specs in admin/posts and admin/comments | |
--- | |
app/controllers/admin/pages_controller.rb | 10 ++++++---- | |
app/controllers/admin/posts_controller.rb | 10 ++++++---- | |
2 files changed, 12 insertions(+), 8 deletions(-) |
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
1) Admin::CommentsController handling DELETE to destroy, JSON request renders comment as json | |
Failure/Error: response.should contain(/#{Regexp.escape(@comment.to_json)}/) | |
expected the following element's content to match /\{"comment":\{"body_html":null,"created_at":null,"author":"xavier","body":null,"updated_at":null,"post_id":null,"author_email":null,"author_url":null\}\}/: | |
{"comment":{"comment":{"created_at":null,"body_html":null,"body":null,"author":"xavier","updated_at":null,"post_id":null,"author_email":null,"author_url":null}},"undo_path":"/admin/undo_items/%23%5BRSpec::Mocks::Mock:0x82b32e8c%20@name=%22undo_item%22%5D/undo","undo_message":"hello"} | |
# ./spec/controllers/admin/comments_controller_spec.rb:129 | |
2) Admin::PostsController handling DELETE to destroy, JSON request renders post as json | |
Failure/Error: response.should contain(/#{Regexp.escape(@post.to_json)}/) | |
expected the following element's content to match /\{"post":\{"cached_tag_list":null,"slug":null,"body_html |
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
From 9fbf4ca64382f48bc2df3397fbfe267172581149 Mon Sep 17 00:00:00 2001 | |
From: James OKelly <[email protected]> | |
Date: Sun, 28 Nov 2010 21:10:07 -0800 | |
Subject: [PATCH] removed pending spec on /pages route, works as intended | |
--- | |
spec/controllers/pages_routing_spec.rb | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/spec/controllers/pages_routing_spec.rb b/spec/controllers/pages_routing_spec.rb |
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
describe "pulling" do | |
it "should pull items from picoticker and create items" do | |
user = Factory.create(:user) | |
picoticker_block = Factory.create(:picoticker_block) | |
picoticker_block.user = user | |
picoticker_block.pull! | |
picoticker_block.picoticker_items.should_not be_empty | |
end | |
end |