Commit 6284b69e by tady

cp config/database.yml for travis

parent c2615229
...@@ -5,5 +5,6 @@ rvm: ...@@ -5,5 +5,6 @@ rvm:
- 2.0.0 - 2.0.0
before_script: before_script:
- mysql -e 'CREATE DATABASE rendezvous_test;' - mysql -e 'CREATE DATABASE rendezvous_test;'
- cp config/database.yml.example config/database.yml
env: env:
- DB_TEST_DATABASE=rendezvous_test DB_TEST_USER=travis - DB_TEST_DATABASE=rendezvous_test DB_TEST_USER=travis
...@@ -72,9 +72,10 @@ group :development do ...@@ -72,9 +72,10 @@ group :development do
# rubocop # rubocop
gem 'rubocop' gem 'rubocop'
gem 'guard-rspec', require: false
gem 'guard-rubocop' gem 'guard-rubocop'
gem 'guard-spring' # gem 'guard-spring'
gem 'spring' # gem 'spring'
# Use Capistrano for deployment # Use Capistrano for deployment
gem 'capistrano', '~> 3.1' gem 'capistrano', '~> 3.1'
......
...@@ -125,12 +125,12 @@ GEM ...@@ -125,12 +125,12 @@ GEM
lumberjack (~> 1.0) lumberjack (~> 1.0)
pry (>= 0.9.12) pry (>= 0.9.12)
thor (>= 0.18.1) thor (>= 0.18.1)
guard-rspec (4.2.3)
guard (~> 2.1)
rspec (>= 2.14, < 4.0)
guard-rubocop (1.0.1) guard-rubocop (1.0.1)
guard (~> 2.0) guard (~> 2.0)
rubocop (~> 0.10) rubocop (~> 0.10)
guard-spring (0.0.4)
guard
spring
hashie (2.0.5) hashie (2.0.5)
hike (1.2.3) hike (1.2.3)
htmlentities (4.3.1) htmlentities (4.3.1)
...@@ -249,6 +249,10 @@ GEM ...@@ -249,6 +249,10 @@ GEM
ref (1.0.5) ref (1.0.5)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7) rspec-core (2.14.7)
rspec-expectations (2.14.4) rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0) diff-lcs (>= 1.1.3, < 2.0)
...@@ -280,7 +284,6 @@ GEM ...@@ -280,7 +284,6 @@ GEM
simplecov-html (~> 0.8.0) simplecov-html (~> 0.8.0)
simplecov-html (0.8.0) simplecov-html (0.8.0)
slop (3.4.7) slop (3.4.7)
spring (1.0.0)
sprockets (2.10.1) sprockets (2.10.1)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
...@@ -347,8 +350,8 @@ DEPENDENCIES ...@@ -347,8 +350,8 @@ DEPENDENCIES
devise devise
factory_girl_rails factory_girl_rails
faraday faraday
guard-rspec
guard-rubocop guard-rubocop
guard-spring
i18n_generators i18n_generators
jbuilder jbuilder
jquery-rails jquery-rails
...@@ -368,7 +371,6 @@ DEPENDENCIES ...@@ -368,7 +371,6 @@ DEPENDENCIES
sass-rails sass-rails
sdoc sdoc
settingslogic settingslogic
spring
therubyracer therubyracer
thin thin
uglifier uglifier
......
# guard :rspec, all_after_pass: true do # guard :rubocop do
# watch(%r{^spec/.+_spec\.rb$})
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
# watch('spec/spec_helper.rb') { 'spec' }
# 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/(.*)(\.erb|\.haml)$}) { 'spec/features' }
# watch(%r{^spec/factories/(.+)\.rb$}) { 'spec/factories_spec.rb' }
# watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
# watch('config/routes.rb') { 'spec/routing' }
# watch('app/controllers/application_controller.rb') { 'spec/controllers' }
# end
# guard :rubocop, all_after_pass: true, cli: ['--rails', '--auto-correct'] do
# watch(%r{.+\.rb$}) # watch(%r{.+\.rb$})
# watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } # watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
# end # end
guard :rubocop do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
guard :rspec do guard :rspec do
watch(%r{^spec/.+_spec\.rb$}) watch(%r{^spec/.+_spec\.rb$})
watch(%r{^spec/spec_helper\.rb$}) { |m| 'spec' } watch(%r{^spec/spec_helper\.rb$}) { |m| 'spec' }
......
...@@ -37,12 +37,12 @@ class Post < ActiveRecord::Base ...@@ -37,12 +37,12 @@ class Post < ActiveRecord::Base
# generate forked post (not saved) # generate forked post (not saved)
def generate_fork(user) def generate_fork(user)
forked_post = Post.new(self.attributes.except(:id)) _forked_post = Post.new(self.attributes.except('id'))
forked_post.title = forked_post.title.gsub(/%Name/, user.name) _forked_post.title = _forked_post.title.gsub(/%Name/, user.name)
forked_post.title = Time.now.strftime(forked_post.title) # TODO _forked_post.title = Time.now.strftime(_forked_post.title) # TODO
forked_post.tag_ids = self.tag_ids _forked_post.tag_ids = self.tag_ids
forked_post.author = user _forked_post.author = user
forked_post _forked_post
end end
end end
...@@ -6,28 +6,28 @@ development: ...@@ -6,28 +6,28 @@ development:
adapter: mysql2 adapter: mysql2
encoding: utf8 encoding: utf8
reconnect: false reconnect: false
database: <%= ENV['DB_DEVELOPMENT_DATABASE'] %>
pool: 5 pool: 5
username: <%= ENV['DB_DEVELOPMENT_USER'] %> host: localhost
password: <%= ENV['DB_DEVELOPMENT_PASS'] %> database: rendezvous_development
host: <%= ENV['DB_DEVELOPMENT_HOST'] %> username: rendezvous
password: rendezvous
test: test:
adapter: mysql2 adapter: mysql2
encoding: utf8 encoding: utf8
reconnect: false reconnect: false
database: <%= ENV['DB_TEST_DATABASE'] %>
pool: 5 pool: 5
username: <%= ENV['DB_TEST_USER'] %> host: localhost
password: <%= ENV['DB_TEST_PASS'] %> database: rendezvous_test
host: <%= ENV['DB_TEST_HOST'] %> username: travis
password:
production: production:
adapter: mysql2 adapter: mysql2
encoding: utf8 encoding: utf8
reconnect: false reconnect: false
database: <%= ENV['DB_PRODUCTION_DATABASE'] %>
pool: 5 pool: 5
username: <%= ENV['DB_PRODUCTION_USER'] %> host: rendezvous.production
password: <%= ENV['DB_PRODUCTION_PASS'] %> database: rendezvous
host: <%= ENV['DB_PRODUCTION_HOST'] %> username: xxxxxxxxxxxxxx
password: xxxxxxxxxxxxxx
...@@ -6,7 +6,8 @@ describe Post do ...@@ -6,7 +6,8 @@ describe Post do
before :each do before :each do
@post = create(:post) @post = create(:post)
@alice = create(:alice) @alice = create(:alice)
@new_post = @post.generate_fork(@alice).save @new_post = @post.generate_fork(@alice)
@new_post.save
end end
describe 'Fork' do describe 'Fork' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment