Skip to content

Commit

Permalink
Merge pull request #34 from jrgifford/master
Browse files Browse the repository at this point in the history
Fixed specs
  • Loading branch information
kevzettler committed Jan 12, 2013
2 parents 6978925 + 5606ea4 commit 5b8bb9b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -5,6 +5,8 @@ gem 'rails', '3.2.11'


group :development, :test do group :development, :test do
gem 'sqlite3' gem 'sqlite3'
gem 'guard'
gem 'guard-rspec'
end end
# Database adapters # Database adapters
gem 'pg', '0.12.2' gem 'pg', '0.12.2'
Expand Down Expand Up @@ -45,6 +47,6 @@ end
group :test do group :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'shoulda-matchers' gem 'shoulda-matchers'
gem 'factory_girl_rails' gem 'factory_girl_rails', '~> 3.0'
gem 'jasmine', :git => "https://github.com/pivotal/jasmine-gem.git", :branch => "1.2.rc1", :group => [:development, :test] gem 'jasmine', :git => "https://github.com/pivotal/jasmine-gem.git", :branch => "1.2.rc1", :group => [:development, :test]
end end
27 changes: 23 additions & 4 deletions Gemfile.lock
Expand Up @@ -78,6 +78,7 @@ GEM
cocaine (>= 0.0.2) cocaine (>= 0.0.2)
mime-types mime-types
cocaine (0.2.1) cocaine (0.2.1)
coderay (1.0.8)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
Expand Down Expand Up @@ -109,12 +110,20 @@ GEM
eventmachine (0.12.10) eventmachine (0.12.10)
execjs (1.3.0) execjs (1.3.0)
multi_json (~> 1.0) multi_json (~> 1.0)
factory_girl (4.1.0) factory_girl (3.1.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.1.0) factory_girl_rails (3.1.0)
factory_girl (~> 4.1.0) factory_girl (~> 3.1.0)
railties (>= 3.0.0) railties (>= 3.0.0)
ffi (1.3.0) ffi (1.3.0)
guard (1.6.1)
listen (>= 0.6.0)
lumberjack (>= 1.0.2)
pry (>= 0.9.10)
thor (>= 0.14.6)
guard-rspec (2.3.3)
guard (>= 1.1)
rspec (~> 2.11)
highline (1.6.11) highline (1.6.11)
hike (1.2.1) hike (1.2.1)
httparty (0.8.1) httparty (0.8.1)
Expand All @@ -134,11 +143,14 @@ GEM
libwebsocket (0.1.7.1) libwebsocket (0.1.7.1)
addressable addressable
websocket websocket
listen (0.7.1)
lumberjack (1.0.2)
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
treetop (~> 1.4.8) treetop (~> 1.4.8)
metaclass (0.0.1) metaclass (0.0.1)
method_source (0.8.1)
mime-types (1.19) mime-types (1.19)
mocha (0.10.5) mocha (0.10.5)
metaclass (~> 0.0.1) metaclass (~> 0.0.1)
Expand All @@ -148,6 +160,10 @@ GEM
orm_adapter (0.0.6) orm_adapter (0.0.6)
pg (0.12.2) pg (0.12.2)
polyglot (0.3.3) polyglot (0.3.3)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
rack (1.4.3) rack (1.4.3)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
Expand Down Expand Up @@ -207,6 +223,7 @@ GEM
shoulda-matchers (1.4.2) shoulda-matchers (1.4.2)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
bourne (~> 1.1.2) bourne (~> 1.1.2)
slop (3.3.3)
sprockets (2.2.2) sprockets (2.2.2)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
Expand Down Expand Up @@ -247,7 +264,9 @@ DEPENDENCIES
devise_cloudfuji_authenticatable devise_cloudfuji_authenticatable
eco eco
execjs execjs
factory_girl_rails factory_girl_rails (~> 3.0)
guard
guard-rspec
jasmine! jasmine!
jquery-rails jquery-rails
kaminari kaminari
Expand Down
37 changes: 37 additions & 0 deletions Guardfile
@@ -0,0 +1,37 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme


guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }

# Capybara features specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }

# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
end


guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch('config/environments/test.rb')
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
watch('test/test_helper.rb') { :test_unit }
watch(%r{features/support/}) { :cucumber }
end
5 changes: 5 additions & 0 deletions spec/factories.rb
Expand Up @@ -7,13 +7,18 @@
"email#{n}@example.com" "email#{n}@example.com"
end end


sequence :password do |n|
"#{rand(11111111...99999999)}"
end

factory :channel do |f| factory :channel do |f|
f.name "Test channel" f.name "Test channel"
end end


factory :user do |f| factory :user do |f|
f.first_name "Test" f.first_name "Test"
f.last_name "User" f.last_name "User"
f.password { Factory.next(:password)}
f.email { Factory.next(:email) } f.email { Factory.next(:email) }
f.ido_id { Factory.next(:ido_id) } f.ido_id { Factory.next(:ido_id) }
end end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/user_spec.rb
Expand Up @@ -8,12 +8,12 @@
end end


it "should have authentication token on creation" do it "should have authentication token on creation" do
@user = Factory :user @user = FactoryGirl.create(:user)
@user.authentication_token.should_not be_nil @user.authentication_token.should_not be_nil
end end


it "should have gravatar hash on creation" do it "should have gravatar hash on creation" do
@user = Factory :user @user = FactoryGirl.create(:user)
@user.gravatar_hash.should_not be_nil @user.gravatar_hash.should_not be_nil
end end
end end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -4,7 +4,7 @@
require 'rspec/rails' require 'rspec/rails'
require 'rspec/autorun' require 'rspec/autorun'
require "#{Rails.root}/lib/active_users.rb" require "#{Rails.root}/lib/active_users.rb"

require 'factory_girl'
# Requires supporting ruby files with custom matchers and macros, etc, # Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories. # in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
Expand Down

0 comments on commit 5b8bb9b

Please sign in to comment.