From 9da7e1fbd24c4c4d0f103afd4c26b3f73229f143 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Tue, 15 Apr 2014 10:38:43 -0400 Subject: [PATCH] Remove newrelic from gemfile, add a couple tests. --- Gemfile | 3 --- Gemfile.lock | 2 -- config/routes.rb | 1 + spec/controllers/campaigns_controller_spec.rb | 16 ++++++++++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 38a84ef..614df1b 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,3 @@ group :test do gem 'webmock' end -group :staging, :production do - gem 'newrelic_rpm', '>= 3.7.3' -end diff --git a/Gemfile.lock b/Gemfile.lock index 0b76ac1..31c581a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,6 @@ GEM mini_portile (0.5.3) minitest (4.7.5) multi_json (1.9.2) - newrelic_rpm (3.7.3.204) nokogiri (1.6.1) mini_portile (~> 0.5.0) orm_adapter (0.5.0) @@ -241,7 +240,6 @@ DEPENDENCIES jbuilder jquery-rails launchy - newrelic_rpm (>= 3.7.3) pg pry-rails rack-timeout diff --git a/config/routes.rb b/config/routes.rb index 8c63c6f..0afef92 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,7 @@ Vidpush::Application.routes.draw do devise_for :users, :controllers => {registrations: "registrations"} end + root to: "campaigns#index" resources :campaigns, param: :clientid diff --git a/spec/controllers/campaigns_controller_spec.rb b/spec/controllers/campaigns_controller_spec.rb index 21f4a8d..f1e4558 100644 --- a/spec/controllers/campaigns_controller_spec.rb +++ b/spec/controllers/campaigns_controller_spec.rb @@ -9,6 +9,22 @@ describe CampaignsController do let(:campaign){ attributes_for :campaign } let(:videolisting){ attributes_for :videolisting } + it 'should show the index page' do + get :index + expect(response.status).to eq 200 + end + + it 'should show the campaign page' do + post :create, campaign: campaign + get :show, campaign + expect(response.status).to eq 200 + end + + it 'raises routing error when campaign not found' do + expect(lambda { get :show, { :clientid => "x" } }).to raise_error(ActionController::RoutingError) + end + + it 'creates a campaign from json post' do post :create, campaign: campaign