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
gem 'sqlite3'
gem 'guard'
gem 'guard-rspec'
end
# Database adapters
gem 'pg', '0.12.2'
Expand Down Expand Up @@ -45,6 +47,6 @@ end
group :test do
gem 'rspec-rails'
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]
end
27 changes: 23 additions & 4 deletions Gemfile.lock
Expand Up @@ -78,6 +78,7 @@ GEM
cocaine (>= 0.0.2)
mime-types
cocaine (0.2.1)
coderay (1.0.8)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
Expand Down Expand Up @@ -109,12 +110,20 @@ GEM
eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
factory_girl (4.1.0)
factory_girl (3.1.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.1.0)
factory_girl (~> 4.1.0)
factory_girl_rails (3.1.0)
factory_girl (~> 3.1.0)
railties (>= 3.0.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)
hike (1.2.1)
httparty (0.8.1)
Expand All @@ -134,11 +143,14 @@ GEM
libwebsocket (0.1.7.1)
addressable
websocket
listen (0.7.1)
lumberjack (1.0.2)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
method_source (0.8.1)
mime-types (1.19)
mocha (0.10.5)
metaclass (~> 0.0.1)
Expand All @@ -148,6 +160,10 @@ GEM
orm_adapter (0.0.6)
pg (0.12.2)
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-cache (1.2)
rack (>= 0.4)
Expand Down Expand Up @@ -207,6 +223,7 @@ GEM
shoulda-matchers (1.4.2)
activesupport (>= 3.0.0)
bourne (~> 1.1.2)
slop (3.3.3)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
Expand Down Expand Up @@ -247,7 +264,9 @@ DEPENDENCIES
devise_cloudfuji_authenticatable
eco
execjs
factory_girl_rails
factory_girl_rails (~> 3.0)
guard
guard-rspec
jasmine!
jquery-rails
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"
end

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

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

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

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

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

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

0 comments on commit 5b8bb9b

Please sign in to comment.