This repository has been archived by the owner on Jan 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add factories_spec.rb and Rake commands
* Remove one factory which created an invalid instance * Add invitee for Event factory, making it valid * Change test to 'build' to create associations * Update failing tests
- Loading branch information
Adarsh Pandit
committed
Sep 11, 2012
1 parent
55a78a5
commit eb9f9cc
Showing
4 changed files
with
26 additions
and
12 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 |
---|---|---|
@@ -1,18 +1,24 @@ | ||
#!/usr/bin/env rake | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
# for example lib/tasks/capistrano.rake, and they will automatically be | ||
# available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
|
||
SchedDo::Application.load_tasks | ||
|
||
if defined?(RSpec) | ||
desc "Run acceptance specs" | ||
desc 'Run factory specs' | ||
RSpec::Core::RakeTask.new(:factory_specs) do |t| | ||
t.pattern = './spec/factories_spec.rb' | ||
end | ||
|
||
desc 'Run acceptance specs' | ||
RSpec::Core::RakeTask.new(:acceptance) do |t| | ||
t.pattern = 'spec/acceptance/**/*.feature' | ||
end | ||
end | ||
|
||
|
||
task spec: :factory_specs | ||
task(:default).clear | ||
task :default => [:spec, :acceptance, 'spec:javascripts'] |
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
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,9 @@ | ||
require 'spec_helper' | ||
|
||
FactoryGirl.factories.map(&:name).each do |factory_name| | ||
describe "The #{factory_name} factory" do | ||
it 'is valid' do | ||
create(factory_name).should be_valid | ||
end | ||
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