Commit fa013e41 authored by Cool Fire's avatar Cool Fire

Merge branch 'development' into 'master'

Push code coverage checks to prod

See merge request !8
parents 54fcd5b7 196dc7fe
Pipeline #370 passed with stages
in 1 minute and 38 seconds
......@@ -44,7 +44,7 @@ rack_test:
stage: testing
image: ruby:2.4-alpine
script:
- gem install rack-test --no-ri --no-rdoc
- gem install simplecov rack-test --no-ri --no-rdoc
- bundle install
- touch .current
- ruby test.rb
......
......@@ -2,3 +2,8 @@
source 'https://rubygems.org'
gem 'sinatra'
group :test, :development do
gem 'rubocop'
gem 'yamllint'
end
GEM
remote: https://rubygems.org/
specs:
mustermann (1.0.0)
rack (2.0.3)
rack-protection (2.0.0)
rack
sinatra (2.0.0)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
tilt (~> 2.0)
tilt (2.0.7)
PLATFORMS
ruby
DEPENDENCIES
sinatra
BUNDLED WITH
1.15.1
# Shell signup site
This website is made to allow users to sign up to the Insomnia 24/7 shell service.
## Requirements
## Build status
Production:
[![build status](https://git.insomnia247.nl/shells/signup-site/badges/master/build.svg)](https://git.insomnia247.nl/shells/signup-site/commits/master) [![coverage report](https://git.insomnia247.nl/shells/signup-site/badges/master/coverage.svg)](https://git.insomnia247.nl/shells/signup-site/commits/master)
Development:
[![build status](https://git.insomnia247.nl/shells/signup-site/badges/development/build.svg)](https://git.insomnia247.nl/shells/signup-site/commits/development) [![coverage report](https://git.insomnia247.nl/shells/signup-site/badges/development/coverage.svg)](https://git.insomnia247.nl/shells/signup-site/commits/development)
## Requirements
### Ruby
......@@ -20,3 +27,6 @@ This should be as simple as running `rackup` and going to `http://localhost:9292
## Contributing
If you have any changes you would like to make or any bugfixes you want to submit you can fork this project, make your changes, and create a merge request through the gitlab interface. Before creating a merge request make sure all syntax, linting, and tests pass. Do not try to commit to your own master branch as gitlab CI will try and fail to deploy it, causing your builds to fail. Always commit to your own development/feature/fix branch and create your merge request from there.
## Deployment
For deployment you won't need testing and development gems. Run `bundle install --without test development` to install only the runtime required gems.
# frozen_string_literal: true
require 'yaml'
config = {
......
......@@ -102,7 +102,9 @@ describe 'Check username' do
follow_redirect!
last_request.url.must_include 'error'
end
end
describe 'Check full set' do
it 'should accept valid usernames, email and reason' do
post '/check-details',
input_username: 'username',
......@@ -123,6 +125,26 @@ describe 'Check reason' do
end
end
describe 'Check email address' do
it 'should reject invalid email addresses' do
post '/check-details',
input_username: 'username',
input_email: 'not really an email.address',
input_reason: 'My reasons are my own.'
follow_redirect!
last_request.url.must_include 'error'
end
it 'should accept valid email addresses' do
post '/check-details',
input_username: 'username',
input_email: 'username@example.com',
input_reason: 'My reasons are my own.'
follow_redirect!
last_request.url.must_include 'not-yet-implemented'
end
end
describe 'Check phonenumber' do
it 'should reject invalid phone numbers' do
post '/check-details',
......@@ -143,6 +165,6 @@ describe 'Check phonenumber' do
follow_redirect!
last_request.url.must_include 'not-yet-implemented'
end
# TODO: checks for error and warning pages
end
# TODO: checks for error and warning pages
# frozen_string_literal: true
ENV['RACK_ENV'] = 'test'
require 'simplecov'
require 'minitest/autorun'
require 'rack/test'
SimpleCov.start
require File.expand_path '../signup_site.rb', __FILE__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment