Nicolae Claudius
13 years ago
13 changed files with 144 additions and 40 deletions
@ -0,0 +1,32 @@
|
||||
# A sample Guardfile |
||||
# More info at https://github.com/guard/guard#readme |
||||
|
||||
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do |
||||
watch('config/application.rb') |
||||
watch('config/environment.rb') |
||||
watch(%r{^config/environments/.+\.rb$}) |
||||
watch(%r{^config/initializers/.+\.rb$}) |
||||
watch('Gemfile') |
||||
watch('Gemfile.lock') |
||||
watch('spec/spec_helper.rb') |
||||
watch('test/test_helper.rb') |
||||
watch(%r{^spec/support/.+\.rb$}) |
||||
end |
||||
|
||||
guard 'rspec', :version => 2, :cli => '--drb', :all_on_start => false, :all_after_pass => false 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{^spec/.+_spec\.rb$}) |
||||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } |
||||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_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('spec/spec_helper.rb') { "spec" } |
||||
watch('config/routes.rb') { "spec/routing" } |
||||
watch('app/controllers/application_controller.rb') { "spec/controllers" } |
||||
# Capybara request specs |
||||
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } |
||||
end |
@ -1,22 +1,25 @@
|
||||
# SQLite version 3.x |
||||
# gem install sqlite3 |
||||
# |
||||
# Ensure the SQLite 3 gem is defined in your Gemfile |
||||
# gem 'sqlite3' |
||||
development: |
||||
adapter: sqlite3 |
||||
database: db/development.sqlite3 |
||||
adapter: mysql2 |
||||
encoding: utf8 |
||||
reconnect: false |
||||
database: entrydns_development |
||||
pool: 5 |
||||
timeout: 5000 |
||||
username: root |
||||
password: root |
||||
host: localhost |
||||
|
||||
# Warning: The database defined as "test" will be erased and |
||||
# re-generated from your development database when you run "rake". |
||||
# Do not set this db to the same as development or production. |
||||
test: |
||||
adapter: sqlite3 |
||||
database: db/test.sqlite3 |
||||
adapter: mysql2 |
||||
encoding: utf8 |
||||
reconnect: false |
||||
database: entrydns_test |
||||
pool: 5 |
||||
timeout: 5000 |
||||
username: root |
||||
password: root |
||||
host: localhost |
||||
|
||||
production: |
||||
adapter: mysql2 |
@ -1,4 +1,6 @@
|
||||
user = User.create :email => 'user@app.com', |
||||
user = User.create( |
||||
:email => 'user@app.com', |
||||
:password => 'useruser', |
||||
:password_confirmation => 'useruser' |
||||
) |
||||
user.confirm! |
||||
|
@ -1,12 +1,37 @@
|
||||
FactoryGirl.define do |
||||
|
||||
sequence(:email){|n| "#{Faker::Internet.user_name}#{n}@example.com"} |
||||
sequence(:password){|n| "password#{n}"} |
||||
sequence(:domain_name){|n| "#{n}#{Faker::Internet.domain_name}"} |
||||
|
||||
factory :user do |
||||
email |
||||
password |
||||
password_confirmation {password} |
||||
end |
||||
|
||||
factory :domain do |
||||
name {FactoryGirl.generate(:domain_name)} |
||||
type 'NATIVE' |
||||
association :soa_record, :factory => :soa_record, :method => :build |
||||
ns_records do |ns_records| |
||||
ns1 = ns_records.association(:ns_record, :method => :build) |
||||
ns2 = ns_records.association(:ns_record, :method => :build) |
||||
ns1.content = Settings.ns.first |
||||
ns2.content = (Settings.ns - [ns1.content]).sample |
||||
[ns1, ns2] |
||||
end |
||||
end |
||||
|
||||
factory :record do |
||||
end |
||||
|
||||
factory :soa_record, :class => 'SOA' do |
||||
contact {Faker::Internet.email} |
||||
end |
||||
|
||||
factory :ns_record, :class => 'NS' do |
||||
content {Settings.ns.sample} |
||||
end |
||||
|
||||
end |
@ -1,5 +1,8 @@
|
||||
require 'spec_helper' |
||||
|
||||
describe Domain do |
||||
pending "add some examples to (or delete) #{__FILE__}" |
||||
let(:domain){Factory(:domain)} |
||||
it "is" do |
||||
domain.should be_valid |
||||
end |
||||
end |
||||
|
Loading…
Reference in new issue