Commit 6284b69e by tady

cp config/database.yml for travis

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