diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad41bea3ea41233044d971c17fc21a6c1d059323..f6a15f89c872f41c0cdc1112f07c57831b6a06b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ syntax_ruby: - find . -name '*\.rb' -exec bash -c 'echo -ne "{}\t\t\t" && ruby -c {}' \; syntax_erb: stage: syntax - image: ruyb:2.4 + image: ruby:2.4 script: - find . -name '*\.erb' -exec bash -c 'echo -ne "{}\t\t\t" && erb -P -x {} | ruby -c' \; lint_ruby: @@ -30,8 +30,9 @@ tests: stage: testing image: ruby:2.4 script: + - gem install rack-test --no-ri --no-rdoc - bundle install - - rake test + - ruby test.rb deploy: stage: deploy image: ubuntu:16.04 diff --git a/test.rb b/test.rb new file mode 100644 index 0000000000000000000000000000000000000000..baca3d403924d2bb56eccde77af5ac99b9f77dc5 --- /dev/null +++ b/test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require File.expand_path '../test_helper.rb', __FILE__ + +include Rack::Test::Methods + +def app + SignupSite +end + +describe 'SignupSite main page' do + it 'should return HTML' do + get '/' + last_response.body.must_include '' + end + + it 'should return the landing page' do + get '/' + last_response.body.must_include 'test' + end +end diff --git a/test_helper.rb b/test_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..8fe5fa2ce32181409603ddac4ed8644e6c18335a --- /dev/null +++ b/test_helper.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +ENV['RACK_ENV'] = 'test' +require 'minitest/autorun' +require 'rack/test' + +require File.expand_path '../signup_site.rb', __FILE__