Commit 5672d5c7 authored by Cool Fire's avatar Cool Fire

Merge branch 'development' into 'master'

Implemented finised page.

See merge request !9
parents fa013e41 6d22857a
Pipeline #372 passed with stages
in 3 minutes and 48 seconds
---
header: Insomnia 24/7 shells signup
body: >
Please enter your invite code below.
body: Please enter your invite code below.
......@@ -4,6 +4,6 @@ blurb: |
<h3>Specifying your reasons</h3>
<p>If you have an invite code you need not enter any additional reasons, though you are free to add them if you so desire. For those of you who do not have an invite code, please be as detailed as possible. Describe what projects you have planned or are working on now, what role our shell server would play in the development process, and why you cannot use another free service such as a free web host or GitHub for example. Add anything else you feel is relevant or may help us decide to give you a shell account.</p>
<p>Though we do not have a set list of reasons for which we do create accounts, there are a few we will definitely not give out accounts for. We are very sorry if this includes your desired usage but we need to enforce this to keep our service viable in the long term. We hope you understand.</p>
<p>The list of known "bad" reasons can be found on <a href="https://wiki.insomnia247.nl/wiki/Shells_FAQ#What_are_bad_reasons_for_an_invite.3F">our wiki</a>.
<p>The list of known "bad" reasons can be found on <a class="text-info" href="https://wiki.insomnia247.nl/wiki/Shells_FAQ#What_are_bad_reasons_for_an_invite.3F">our wiki</a>.
body: >
Please enter your details below.
---
header: Insomnia 24/7 shells signup
body: Thank you for signing up. You will hear from us soon with further details.
......@@ -15,7 +15,7 @@ class SignupSite < Sinatra::Base
post '/check-details' do
cd = YAML.load_file('content/check-details.yaml')
session[:error_location] = '/enter-details'
session[:error_proceed] = '/not-yet-implemented'
session[:error_proceed] = '/finished'
session[:error_progress] = 50
session[:username] = Rack::Utils.escape_html(params[:input_username])
......@@ -26,7 +26,7 @@ class SignupSite < Sinatra::Base
if session[:username] !~ /^\w+$/
session[:error_message] = cd['error_message_username']
redirect '/error', 302
elsif session[:email] !~ /^\w+@\w+\.\w+$/
elsif session[:email] !~ /^\S+@\S+\.\w+$/
session[:error_message] = cd['error_message_email']
redirect '/error', 302
elsif check_phone session[:phone]
......@@ -36,7 +36,8 @@ class SignupSite < Sinatra::Base
session[:error_message] = cd['error_message_reason']
redirect '/warning', 302
else
redirect '/not-yet-implemented', 302
# TODO: put new request into database and call notification handlers
redirect '/finished', 302
end
end
......
# frozen_string_literal: true
# Finished page
class SignupSite < Sinatra::Base
get '/finished' do
fi = YAML.load_file('content/finished.yaml')
@header = fi['header']
@body = fi['body']
@form = erb :finished
@progress = 100
erb :index
end
end
......@@ -23,3 +23,4 @@ end
require_relative 'routes/code'
require_relative 'routes/details'
require_relative 'routes/error'
require_relative 'routes/finished'
......@@ -111,7 +111,7 @@ describe 'Check full set' do
input_email: 'username@example.com',
input_reason: 'My reasons are my own.'
follow_redirect!
last_request.url.must_include 'not-yet-implemented'
last_request.url.must_include 'finished'
end
end
......@@ -141,7 +141,7 @@ describe 'Check email address' do
input_email: 'username@example.com',
input_reason: 'My reasons are my own.'
follow_redirect!
last_request.url.must_include 'not-yet-implemented'
last_request.url.must_include 'finished'
end
end
......@@ -163,8 +163,18 @@ describe 'Check phonenumber' do
input_reason: 'My reasons are my own.',
input_phone: '+31628282828'
follow_redirect!
last_request.url.must_include 'not-yet-implemented'
last_request.url.must_include 'finished'
end
end
# TODO: checks for error and warning pages
describe 'Error and warning pages' do
it 'should display error message from session' do
get '/error', {}, 'rack.session' => { error_message: 'This is an error' }
last_response.body.must_include 'This is an error'
end
it 'should display warning message from session' do
get '/warning', {}, 'rack.session' => { error_message: 'This is a warning' }
last_response.body.must_include 'This is a warning'
end
end
Feel free to <a class="text-info" href="https://www.insomnia247.nl/page/contact">contact us</a> if you have any questions or comments.
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