-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up testing Rails db stuff (shamelessly stolen from Object Daddy) …
…and started on spec.
- Loading branch information
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'chronic' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
require 'autochronic' | ||
require 'activerecord' | ||
|
||
setup_rails_database | ||
|
||
class SpaceCowboy < ActiveRecord::Base | ||
end | ||
|
||
describe SpaceCowboy do | ||
before :each do | ||
@toker = SpaceCowboy.new | ||
end | ||
|
||
describe "'some_date' field" do | ||
it 'should accept a date object' do | ||
date = Date.civil(2008, 2, 7) | ||
date_input = date | ||
@toker.some_date = date_input | ||
@toker.some_date.should == date | ||
end | ||
|
||
it 'should accept a date string' | ||
it 'should accept a natural language date string' | ||
it 'should be nil on unusable input' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sqlite3: | ||
:adapter: sqlite3 | ||
:dbfile: vendor/plugins/autochronic/spec/tmp/autochronic.db |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveRecord::Schema.define(:version => 0) do | ||
create_table :space_cowboys, :force => true do |t| | ||
t.date :some_date | ||
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
Empty file.