require File.dirname(__FILE__) + '/../spec_helper' require 'taskwarrior-web' set :environment, :test describe TaskwarriorWeb::App do include Rack::Test::Methods def app TaskwarriorWeb::App end before do TaskwarriorWeb::Config.should_receive(:property).with('task-web.user').any_number_of_times.and_return(nil) TaskwarriorWeb::Config.should_receive(:property).with('task-web.filter').any_number_of_times.and_return(nil) TaskwarriorWeb::Runner.should_receive(:run).any_number_of_times.and_return('{}') end ['/', '/tasks'].each do |path| describe "GET #{path}" do it 'should redirect to /tasks/pending' do get path follow_redirect! last_request.url.should match(/tasks\/pending$/) last_response.should be_ok end end end describe 'GET /tasks/new' do it 'should display a new task form' do get '/tasks/new' last_response.body.should include('