From ab8b02f890317e35436520c65b67582b7b21c089 Mon Sep 17 00:00:00 2001 From: iCHAIT Date: Fri, 5 Aug 2016 00:03:36 +0530 Subject: [PATCH] initiated tests --- Gemfile | 1 + tests.rb | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests.rb diff --git a/Gemfile b/Gemfile index 7d1a18c..6e46135 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ gem 'shotgun', '~> 0.9.1' gem 'sinatra-flash', '~> 0.3.0' gem 'rubocop', require: false gem 'sinatra-contrib', '~> 1.4', '>= 1.4.7' +gem 'rack-test', '~> 0.6.3' \ No newline at end of file diff --git a/tests.rb b/tests.rb new file mode 100644 index 0000000..89b4fd5 --- /dev/null +++ b/tests.rb @@ -0,0 +1,41 @@ +require_relative 'app' +require 'test/unit' +require 'rack/test' + +class MyAppTest < Test::Unit::TestCase + include Rack::Test::Methods + + def app + Sinatra::Application + end + + def test_login_endpoint + get '/' + assert last_response.body.include?('Please Sign In') + end + + def test_home_endpoint + get '/home' + assert last_response.body.include?('View Details') + end + + def test_activities_endpoint + get '/activities' + assert last_response.body.include?('Activities') + end + + def test_projects_endpoint + get '/projects' + assert last_response.body.include?('Projects') + end + + def test_times_endpoint + get '/times' + assert last_response.body.include?('Times') + end + + def test_users_endpoint + get '/users' + assert last_response.body.include?('Users') + end +end \ No newline at end of file