Skip to content

Commit

Permalink
Removed branding from default page, fixed tests (MLH#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
theycallmeswift authored May 31, 2017
1 parent 434a0cb commit 486bf4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions no_light_sinatra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
end

class NoLightSinatra < Sinatra::Base
# use Airbrake::Rack::Middleware
use Airbrake::Rack::Middleware unless ENV['RACK_ENV'] == 'test'
set public_folder: 'public', static: true

configure do
Expand Down Expand Up @@ -56,7 +56,7 @@ class NoLightSinatra < Sinatra::Base
show_editor(DEFAULT_BRANDING)
end

get '/:hackathon/:branding' do
get '/:hackathon/:branding?' do
show_editor(params[:branding])
end

Expand Down
8 changes: 8 additions & 0 deletions spec/visitor_can_visit_branded_editor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ def app
describe NoLightSinatra do

it 'loads the default editor' do
visit_branded_editor(nil)

page.find_classes('body.editor').wont_include :dell
page.find('#submission_html')["placeholder"].must_equal 'Enter your code here ...'
page.find('#submit').text.must_equal '!light'
end

it 'loads the dell branded editor' do
visit_branded_editor(:dell)

page.find_classes('body.editor').must_include :dell
Expand Down

0 comments on commit 486bf4a

Please sign in to comment.