Skip to content

Commit

Permalink
Updated Gemfile
Browse files Browse the repository at this point in the history
- Added implementation for specs
  • Loading branch information
sivagollapalli committed Apr 13, 2012
1 parent 6e08d52 commit fe46fbf
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ group :test do
gem 'rspec-rails', '>=2.8.0rc1'
gem 'faker'
gem 'database_cleaner'
gem 'shoulda'
gem 'shoulda-matchers'
gem 'factory_girl_rails', '1.4.0'
end

Expand Down
7 changes: 2 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GEM
remote: https://rubygems.org/
specs:
arel (3.0.2)
bootstrap-sass (2.0.2)
builder (3.0.0)
coffee-script (2.2.0)
coffee-script-source
Expand Down Expand Up @@ -146,10 +147,6 @@ GEM
railties (>= 3.0)
rspec (~> 2.9.0)
sass (3.1.15)
shoulda (3.0.1)
shoulda-context (~> 1.0.0)
shoulda-matchers (~> 1.0.0)
shoulda-context (1.0.0)
shoulda-matchers (1.0.0)
sprockets (2.1.2)
hike (~> 1.2)
Expand Down Expand Up @@ -185,5 +182,5 @@ DEPENDENCIES
rails!
rspec-rails (>= 2.8.0rc1)
sass-rails!
shoulda
shoulda-matchers
uglifier (>= 1.0.3)
16 changes: 15 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120407142824) do
ActiveRecord::Schema.define(:version => 20120413132703) do

create_table "categories", :force => true do |t|
t.string "name"
Expand All @@ -27,6 +27,13 @@
t.datetime "updated_at", :null => false
end

create_table "idea_categories", :force => true do |t|
t.integer "idea_id"
t.integer "category_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "idea_users", :force => true do |t|
t.integer "idea_id"
t.integer "user_id"
Expand All @@ -50,4 +57,11 @@
t.datetime "updated_at", :null => false
end

create_table "users", :force => true do |t|
t.string "name"
t.string "auth_hash"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

end
3 changes: 3 additions & 0 deletions spec/models/comment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
it { should validate_presence_of(:description) }
it { should validate_presence_of(:user_id) }
it { should validate_presence_of(:idea_id) }

it { should belong_to(:idea)}
it { should belong_to(:user)}
end
4 changes: 4 additions & 0 deletions spec/models/idea_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
it { should validate_presence_of(:title)}
it { should validate_presence_of(:description)}
it { should validate_presence_of(:user_id)}

it { should have_many(:users)}
it { should have_many(:comments)}
it { should have_many(:schedules)}
end
9 changes: 9 additions & 0 deletions spec/models/idea_users_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'spec_helper'

describe IdeaUser do
it { should validate_presence_of(:user_id)}
it { should validate_presence_of(:idea_id)}

it { should belong_to(:user)}
it { should belong_to(:idea)}
end
4 changes: 3 additions & 1 deletion spec/models/schedule_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'spec_helper'

describe Schedule do
it { should validate_presence_of(:schedule_at) }
it { should validate_presence_of(:scheduled_at) }
it { should validate_presence_of(:location) }
it { should validate_presence_of(:idea_id) }

it { should belong_to(:idea)}
end
2 changes: 0 additions & 2 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'spec_helper'

describe User do
it { should validate_presence_of(:email) }
it { should validate_presence_of(:email) }
end
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
RSpec.configure do |config|
config.mock_with :rspec

config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
Expand Down

0 comments on commit fe46fbf

Please sign in to comment.