Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added specs for validations

  • Loading branch information...
commit 7a0d2eb835f6671294b9f0ac7586ec0f6e1f37f4 1 parent 046c6bf
@sivagollapalli sivagollapalli authored
View
2  .rspec
@@ -0,0 +1,2 @@
+--color
+--format progress
View
8 Gemfile
@@ -21,6 +21,14 @@ end
gem 'jquery-rails'
+group :test do
+ gem 'rspec-rails', '>=2.8.0rc1'
+ gem 'faker'
+ gem 'database_cleaner'
+ gem 'shoulda'
+ gem 'factory_girl_rails', '1.4.0'
+end
+
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
28 Gemfile.lock
@@ -85,9 +85,18 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.2.0)
+ database_cleaner (0.7.1)
+ diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.0)
multi_json (~> 1.0)
+ factory_girl (2.3.2)
+ activesupport
+ factory_girl_rails (1.4.0)
+ factory_girl (~> 2.3.0)
+ railties (>= 3.0.0)
+ faker (1.0.1)
+ i18n (~> 0.4)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (2.0.2)
@@ -112,7 +121,21 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
+ rspec-rails (2.8.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.8.0)
sass (3.1.15)
+ shoulda (2.11.3)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
@@ -133,9 +156,14 @@ PLATFORMS
DEPENDENCIES
arel!
coffee-rails!
+ database_cleaner
+ factory_girl_rails (= 1.4.0)
+ faker
journey!
jquery-rails
mysql2
rails!
+ rspec-rails (>= 2.8.0rc1)
sass-rails!
+ shoulda
uglifier (>= 1.0.3)
View
5 spec/models/category_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Category do
+ it { should validate_presence_of(:name) }
+end
View
7 spec/models/comment_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe Comment do
+ it { should validate_presence_of(:description) }
+ it { should validate_presence_of(:user_id) }
+ it { should validate_presence_of(:idea_id) }
+end
View
7 spec/models/idea_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe Idea do
+ it { should validate_presence_of(:title)}
+ it { should validate_presence_of(:description)}
+ it { should validate_presence_of(:user_id)}
+end
View
7 spec/models/schedule_spec.rb
@@ -0,0 +1,7 @@
+require 'spec_helper'
+
+describe Schedule do
+ it { should validate_presence_of(:schedule_at) }
+ it { should validate_presence_of(:location) }
+ it { should validate_presence_of(:idea_id) }
+end
View
6 spec/models/user_spec.rb
@@ -0,0 +1,6 @@
+require 'spec_helper'
+
+describe User do
+ it { should validate_presence_of(:email) }
+ it { should validate_presence_of(:email) }
+end
View
11 spec/spec_helper.rb
@@ -0,0 +1,11 @@
+# This file was generated by the `rspec --init` command. Conventionally, all
+# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
+# Require this file using `require "spec_helper.rb"` to ensure that it is only
+# loaded once.
+#
+# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
+RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.run_all_when_everything_filtered = true
+ config.filter_run :focus
+end
Please sign in to comment.
Something went wrong with that request. Please try again.