spec/woyo/server/1_server_spec.rb in woyo-server-0.0.1 vs spec/woyo/server/1_server_spec.rb in woyo-server-0.0.2

- old
+ new

@@ -6,10 +6,11 @@ before :all do @small_world = Woyo::World.new do location :small end @home_world = Woyo::World.new do + start :home location :home do name 'Home' description 'Where the heart is.' way :out do name 'Door' @@ -51,24 +52,47 @@ end end end end - it 'displays a welcome page if there is no world' do - # this must be the first test so that Woyo::Server.setting.world is not set - # that is why this file is name 1_server_spec.rb + # these must be the first tests so that Woyo::Server.setting.world is not set + # that is why this file is name 1_server_spec.rb + + it 'welcome page is displayed if there is no world' do visit '/' status_code.should eq 200 - page.should have_content 'Welcome' + page.should have_content 'Woyo' end - it 'accepts a world' do + it 'welcome page links to github docs' do + visit '/' + status_code.should eq 200 + page.should have_link '', href: 'https://github.com/iqeo/woyo-world/wiki' + page.should have_link '', href: 'https://github.com/iqeo/woyo-server/wiki' + end + + it 'uses foundation framework' do + visit '/' + status_code.should eq 200 + page.should have_css 'head link[href="foundation/css/foundation.css"]' + page.should have_css 'head script[src="foundation/js/vendor/modernizr.js"]' + end + + it 'accepts a world (without start - display welcome)' do Woyo::Server.set :world, @small_world visit '/' status_code.should eq 200 + page.should have_content 'Woyo' end - it 'describes a location' do + it 'accepts a world (with start)' do + @small_world.start = :small + Woyo::Server.set :world, @small_world + visit '/' + status_code.should eq 200 + end + + it 'describes the start location' do Woyo::Server.set :world, @home_world visit '/' page.should have_selector '.location#location_home' page.should have_selector '.location#location_home .name', text: 'Home' page.should have_selector '.location#location_home .description', text: 'Where the heart is.'