diff --git a/.rspec b/.rspec index 57fcb573..34c5164d 100644 --- a/.rspec +++ b/.rspec @@ -1,3 +1,3 @@ --fp +--format documentation --color --require spec_helper diff --git a/Gemfile b/Gemfile index c5c61dbe..92db9096 100644 --- a/Gemfile +++ b/Gemfile @@ -1,25 +1,27 @@ source 'https://rubygems.org' -ruby "1.9.3" +ruby '1.9.3' +# Framework and core dependencies +gem 'rails', '3.2.13' +gem 'pg' gem 'unicorn' +gem 'foreman' -gem 'rails', '3.2.13' -gem 'bootstrap-sass', '2.1' +gem 'crowdtilt', github: 'Crowdtilt/crowdtilt-gem' gem 'devise' -gem 'email_spec' gem 'nokogiri' -gem 'pg' -gem "friendly_id", "~> 4.0.9" -gem "iso_country_codes" - +gem 'friendly_id', '~> 4.0.9' +gem 'iso_country_codes' gem 'paperclip', '~> 3.0' gem 'ckeditor' gem 'aws-sdk' - -gem 'foreman' - gem 'active_model_serializers' +# Front-end +gem 'bootstrap-sass', '2.1' +gem 'jquery-rails' +gem 'jquery-ui-rails' + group :production do gem 'newrelic_rpm' gem 'lograge' @@ -31,14 +33,14 @@ group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' - gem "asset_sync" + gem 'asset_sync' end group :development, :test do gem 'pry-rails' gem 'rspec-rails' - gem 'shoulda' gem 'factory_girl_rails' + gem 'shoulda' end group :development do @@ -46,12 +48,7 @@ group :development do end group :test do - gem "faker" - gem "capybara" + gem 'faker' + gem 'capybara' + gem 'email_spec' end - -# jQuery & jQuery UI -gem 'jquery-rails' -gem 'jquery-ui-rails' - -gem 'crowdtilt', github: 'msaint/crowdtilt' diff --git a/Gemfile.lock b/Gemfile.lock index 6e0d8aaa..9df9df5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT - remote: git://github.com/msaint/crowdtilt.git - revision: faa74632ac6c5b35f44b289e8e04252a7297f68d + remote: git://github.com/Crowdtilt/crowdtilt-gem.git + revision: 07fe38717db747e2ab5de304a382ceda973c9711 specs: - crowdtilt (0.0.1) + crowdtilt (1.0.0) activesupport faraday (~> 0.8, < 0.10) faraday_middleware (~> 0.9.0) @@ -92,10 +92,10 @@ GEM factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) - faker (1.1.2) + faker (1.2.0) i18n (~> 0.5) - faraday (0.8.7) - multipart-post (~> 1.1) + faraday (0.8.8) + multipart-post (~> 1.2.0) faraday_middleware (0.9.0) faraday (>= 0.7.4, < 0.9) fog (1.11.1) diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index 4301feba..e85c4361 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -10,7 +10,7 @@ def payment_notification(payment_id) if (recipients.length > 0) begin - @settings = Settings.find_by_id(1) + @settings = Settings.first @payment = Payment.find(payment_id) rescue ActiveRecord::RecordNotFound logger.error "Email failed - could not find Payment #{payment_id}" diff --git a/config/routes.rb b/config/routes.rb index 04279ad0..e9c2878b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,8 @@ root to: 'pages#index' # USERS - devise_for :users, { path: 'account', controllers: { registrations: :registrations } } do + devise_for :users, { path: 'account', controllers: { registrations: :registrations } } + devise_scope :user do match '/user/settings', to: 'devise/registrations#edit', as: :user_settings end diff --git a/spec/controllers/api/v0/payments_controller_spec.rb b/spec/controllers/api/v0/payments_controller_spec.rb index 3bfd0790..ce496185 100644 --- a/spec/controllers/api/v0/payments_controller_spec.rb +++ b/spec/controllers/api/v0/payments_controller_spec.rb @@ -3,7 +3,6 @@ describe Api::V0::PaymentsController do describe '#index' do - FactoryGirl.create(:user, :admin) let(:settings) { create(:settings) } let!(:api_key) { settings.api_key } diff --git a/spec/fixtures/orders.yml b/spec/fixtures/orders.yml deleted file mode 100644 index fb5d9b3d..00000000 --- a/spec/fixtures/orders.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html - -one: - user_id: 1 - token: MyString - transaction_id: MyString - address_one: MyString - address_two: MyString - city: MyString - state: MyString - zip: MyString - country: MyString - status: MyString - number: MyString - name: Marin - price: 123.05 - uuid: ec781fa2-c5e6-4af9-8049-4dee15a85296 - -two: - user_id: 2 - transaction_id: MyString - address_one: MyString - address_two: MyString - city: MyString - state: MyString - zip: MyString - country: MyString - status: MyString - number: MyString - uuid: MyString diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml deleted file mode 100644 index 05defec2..00000000 --- a/spec/fixtures/users.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html - -one: - email: mneorr@gmail.com - id: 1 - -two: - email: MyString - id: 2 diff --git a/spec/mailers/admin_mailer_spec.rb b/spec/mailers/admin_mailer_spec.rb index 0052e835..86b5a2e1 100644 --- a/spec/mailers/admin_mailer_spec.rb +++ b/spec/mailers/admin_mailer_spec.rb @@ -3,10 +3,12 @@ include EmailSpec::Matchers describe AdminMailer, '#payment_notification' do - before(:all) do - campaign = FactoryGirl.create(:campaign) - @payment = FactoryGirl.create(:payment, campaign: campaign) - @email = AdminMailer.payment_notification(@payment) + before(:each) do + FactoryGirl.create(:settings) + FactoryGirl.create(:user, :admin) + @campaign = FactoryGirl.create(:campaign) + @payment = FactoryGirl.create(:payment, campaign: @campaign) + @email = AdminMailer.payment_notification(@payment.id) end it 'delivers the snippet to the proper address' do @@ -14,7 +16,7 @@ end it "has the correct subject" do - expect(@email).to have_subject(/Your Crowdhoster project has a new backer!/) + expect(@email).to have_subject(/New backer for \"#{@campaign.name}\"/) end it "contains the proper copy" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6894dbc..358352c7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,7 +2,7 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' -require 'rspec/autorun' +require 'capybara/rspec' require 'email_spec' # Requires supporting ruby files with custom matchers and macros, etc, @@ -18,9 +18,6 @@ # config.mock_with :flexmock # config.mock_with :rr - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. @@ -37,10 +34,6 @@ # --seed 1234 config.order = "random" - def create(*args) - FactoryGirl.create(*args) - end - # Include Factory Girl syntax to simplify calls to factories config.include FactoryGirl::Syntax::Methods end