Skip to content

Instantly share code, notes, and snippets.

View rhysforyou's full-sized avatar

Rhys Powell rhysforyou

View GitHub Profile
› rake spec cucumber
/Users/rpowell93/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/controllers/books_controller_spec.rb ./spec/helpers/books_helper_spec.rb ./spec/models/book_spec.rb ./spec/views/books/new.html.erb_spec.rb
..F
Failures:
1) books/new.html.erb should render a form to add a new book
Failure/Error: render
ActionView::Template::Error:
No input found for Book_#<RSpec::Core::ExampleGroup::Nested_3:0x007fedfdb83510>
require 'spec_helper'
describe BooksController do
before :each do
mock_model("Book")
end
describe "GET 'new'" do
before :each do
› rake spec cucumber
/Users/rpowell93/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/controllers/books_controller_spec.rb ./spec/helpers/books_helper_spec.rb ./spec/models/book_spec.rb ./spec/views/books/index.html.erb_spec.rb ./spec/views/books/new.html.erb_spec.rb
.F....
Failures:
1) BooksController POST 'index' creates a new Book given valid attributes
Failure/Error: (Book.count > initial_count).should be_true
expected false to be true
# ./spec/controllers/books_controller_spec.rb:28:in `block (3 levels) in <top (required)>'
› rake db:migrate db:test:load
NOTICE: database "lastreads_test" does not exist, skipping
PGError: ERROR: permission denied to create database
: CREATE DATABASE "lastreads_test" ENCODING = 'unicode'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `async_exec'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/activerecord-3.1.3/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in execute'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/activesupport-3.1.3/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
/Users/rpowell93/.rvm/gems/ruby-1.9.3-p0@lastreads/gems/active
describe "PUT '/books/:id'" do
it "should update a Book's attributes" do
@book = FactoryGirl.create(:book)
new_attrs = {title: "New title", author: "New Author"}
put :update, :id => @book.id, :book => new_attrs
@book.reload
@book.title.should eq("New title")
@book.author.should eq("New Author")
end
end
#import "Game.h"
#import <SenTestingKit/SenTestingKit.h>
@interface BowlingGameTest : SenTestCase
{
}
@end
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(close:)];
}
//
// DurationPickerViewController.m
// Tomato
//
// Created by Rhys Powell on 12/12/11.
// Copyright (c) 2011 Smith's Hill High School. All rights reserved.
//
#import "DurationPickerViewController.h"
#import <UIKit/UIKit.h>
@class Task;
@interface TaskDurationViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>
@property (strong, nonatomic) Task *task;
@property (strong, nonatomic) IBOutlet UILabel *pomodoroLabel;
@property (strong, nonatomic) IBOutlet UILabel *minuteLabel;
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface Task : NSManagedObject
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSNumber * duration;