diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c9d93c3..313ced5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -52,4 +52,10 @@ module ApplicationHelper def default_avatar_filename image_path "default_avatar.png" end + + def color_check_asciicast_path + if id = CFG['COLOR_CHECK_CAST_ID'] + asciicast_path(id) + end + end end diff --git a/app/views/docs/about.html.erb b/app/views/docs/about.html.erb index fd2d142..2b82cf3 100644 --- a/app/views/docs/about.html.erb +++ b/app/views/docs/about.html.erb @@ -27,7 +27,7 @@ uploading it to [ascii.io](http://ascii.io) site. Web based player is a JavaScript implementation of [VT102 ANSI terminal](http://en.wikipedia.org/wiki/VT102), supporting most ANSI control codes and sequences, all text attributes and -[256 colors](<%= asciicast_path(CFG['COLOR_CHECK_CAST_ID']) %>). +[256 colors](<%= color_check_asciicast_path %>). ## Authors diff --git a/spec/features/docs_spec.rb b/spec/features/docs_spec.rb new file mode 100644 index 0000000..6f2fb4e --- /dev/null +++ b/spec/features/docs_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +feature "Docs" do + + scenario 'Visiting about page' do + visit docs_path(:about) + + within('.main') do + expect(page).to have_content('About') + end + + expect_doc_links + end + + scenario 'Visiting getting started page' do + visit docs_path(:record) + + within('.main') do + expect(page).to have_content('Getting started') + end + + expect_doc_links + end + + scenario 'Visiting options page' do + visit docs_path(:options) + + within('.main') do + expect(page).to have_content('Recorder options') + end + + expect_doc_links + end + +end diff --git a/spec/support/feature_helpers.rb b/spec/support/feature_helpers.rb index e034022..effe644 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/feature_helpers.rb @@ -39,5 +39,11 @@ module AsciiIo expect(page).to have_link('Popular') end + def expect_doc_links + expect(page).to have_link('About') + expect(page).to have_link('Getting started') + expect(page).to have_link('Recorder options') + end + end end