From 6224a20792f9f811eb9ed457a7bf6293f81a0e0c Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Fri, 10 Apr 2015 10:03:33 -0700 Subject: [PATCH] Add spec tests for dashboard redirect --- spec/vmpooler/api_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/vmpooler/api_spec.rb b/spec/vmpooler/api_spec.rb index 5707e83..246503f 100644 --- a/spec/vmpooler/api_spec.rb +++ b/spec/vmpooler/api_spec.rb @@ -11,13 +11,20 @@ describe Vmpooler::API do describe 'Dashboard' do context '/' do + before { get '/' } + + it { expect(last_response.status).to eq(302) } + it { expect(last_response.location).to eq('http://example.org/dashboard/') } + end + + context '/dashboard/' do let(:config) { { config: {'site_name' => 'test pooler'} } } before do $config = config - get '/' + get '/dashboard/' end it { expect(last_response).to be_ok } @@ -166,4 +173,4 @@ describe Vmpooler::API do end -end \ No newline at end of file +end