diff --git a/Gemfile b/Gemfile index 4c7d000..94ea712 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,6 @@ gem 'will_paginate', '~> 3.0.3' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem "twitter-bootstrap-rails", "~> 2.0.3" diff --git a/Gemfile.lock b/Gemfile.lock index cdc4ff0..9224536 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/spacemunkay/acts_as_loggable.git - revision: 6033fe5a44878bb374f73fe473fed9a3396ddc74 + revision: 49e264849ed9018445fb999cacfc55e1e28d7faa specs: acts_as_loggable (0.0.7) activerecord (>= 3.0) @@ -178,11 +178,6 @@ GEM railties (>= 3.0) rspec (~> 2.8.0) rubyzip (0.9.9) - sass (3.2.7) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) selenium-webdriver (2.31.0) childprocess (>= 0.2.5) multi_json (~> 1.0) @@ -248,7 +243,6 @@ DEPENDENCIES rails (= 3.2.13) rb-fsevent rspec-rails (~> 2.8.1) - sass-rails (~> 3.2.3) shoulda-matchers (~> 1.0.0) spork sqlite3 (~> 1.3.5) diff --git a/Rakefile b/Rakefile index 5164c52..8c2e9b2 100644 --- a/Rakefile +++ b/Rakefile @@ -12,16 +12,20 @@ require File.expand_path('../config/application', __FILE__) Velocipede::Application.load_tasks -namespace :spec do - desc 'Run all acceptance specs' - RSpec::Core::RakeTask.new(:acceptance => 'db:test:prepare') do |t| - t.pattern = '**/*.feature' +unless Rails.env.production? + + namespace :spec do + desc 'Run all acceptance specs' + RSpec::Core::RakeTask.new(:acceptance => 'db:test:prepare') do |t| + t.pattern = '**/*.feature' + end end -end -Rake.application.remove_task 'spec' + Rake.application.remove_task 'spec' + + desc 'Run all specs' + RSpec::Core::RakeTask.new(:spec => 'db:test:prepare') do |t| + t.pattern = '**/*{_spec.rb,.feature}' + end -desc 'Run all specs' -RSpec::Core::RakeTask.new(:spec => 'db:test:prepare') do |t| - t.pattern = '**/*{_spec.rb,.feature}' end diff --git a/db/seeds.rb b/db/seeds.rb index 89a9000..197c412 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -24,7 +24,6 @@ if Rails.env.development? if User.all.empty? FactoryGirl.create(:user) FactoryGirl.create(:staff) - FactoryGirl.create(:admin) FactoryGirl.create(:bike_admin) FactoryGirl.create(:user_profile) end @@ -35,4 +34,16 @@ if Rails.env.development? FactoryGirl.create(:bike) end end +elsif Rails.env.production? + + if User.all.empty? + #create an admin + admin = User.create!( :username => 'admin', + :first_name => 'admin', + :last_name => 'admin', + :email=>'admin@example.com', + :password=>'password') + admin.roles << Role.find_by_role('admin') + end + end