Skip to content

Commit

Permalink
Merge branch 'master' of github.com:domify/registry
Browse files Browse the repository at this point in the history
  • Loading branch information
mlensment committed Feb 23, 2015
2 parents 00ecdba + 15c296f commit 143fb7e
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: ruby
rvm:
- 2.2
- ruby-head
env:
- DB=postgresql
sudo: false
before_install:
- gem install bundler
- "rm ${BUNDLE_GEMFILE}.lock"
before_script:
- psql -c 'create database registry_test;' -U postgres
- psql -c 'create database registry_whois_test;' -U postgres
- psql -c 'create database registry_api_log_test;' -U postgres
- bundle update
- cp config/application-example.yml config/application.yml
- cp config/secrets-example.yml config/secrets.yml
- cp config/database-travis.yml config/database.yml
- RAILS_ENV=test bundle exec rake db:all:schema:load
- RAILS_ENV=test bundle exec rake db:seed
script:
- RAILS_ENV=test bundle exec rake
cache: bundler
services:
- postgresql
addons:
postgresql: "9.3"
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,7 @@ group :development, :test do

# dev tools
gem 'unicorn'

# for travis
gem 'rake'
end
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ DEPENDENCIES
railroady (~> 1.3.0)
rails (= 4.2.0)
rails-settings-cached (~> 0.4.1)
rake
ransack (~> 1.5.1)
rspec-rails (~> 3.0.2)
rubocop (~> 0.26.1)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,8 @@ This needs a static greeting file, so you will have to make /var/www writable.
mkdir epp

Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp

## Code Status

Alpha release status, only model tests:
[![Build Status](https://travis-ci.org/domify/registry.svg?branch=master)](https://travis-ci.org/domify/registry)
12 changes: 4 additions & 8 deletions app/models/epp/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ class Epp::Contact < Contact
# disable STI, there is type column present
self.inheritance_column = :sti_disabled

# temp fix
has_many :legal_documents, as: :documentable

class << self
# rubocop: disable Metrics/PerceivedComplexity
# rubocop: disable Metrics/CyclomaticComplexity
Expand Down Expand Up @@ -54,11 +51,10 @@ def new(frame)
end

def legal_document_attrs(legal_frame)
attrs = {}.with_indifferent_access
attrs[0] = {}.with_indifferent_access
attrs[0][:body] = legal_frame.text
attrs[0][:document_type] = legal_frame['type']
attrs
[{
body: legal_frame.text,
document_type: legal_frame['type']
}]
end
end

Expand Down
19 changes: 19 additions & 0 deletions config/database-travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default: &default
host: localhost
adapter: postgresql
encoding: unicode
pool: 5
username: postgres
password:

test:
<<: *default
database: registry_test

whois_test:
<<: *default
database: registry_whois_test

api_log_test:
<<: *default
database: registry_api_log_test
2 changes: 1 addition & 1 deletion lib/tasks/db.rake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace :db do
databases.each do |name|
begin
puts "\n---------------------------- #{name} ----------------------------------------\n"
ActiveRecord::Base.establish_connection(name)
ActiveRecord::Base.establish_connection(name.to_sym)
if ActiveRecord::Base.connection.table_exists?('schema_migrations')
puts 'Found tables, skip schema load!'
else
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ begin
end

Rake::Task[:default].prerequisites.clear
task default: :test
task default: 'test:other'

def test_against_server
_stdin, _stdout, _stderr, wait_thr = Open3.popen3('unicorn -E test -p 8989')
Expand Down

0 comments on commit 143fb7e

Please sign in to comment.