remove steam related specs

arnaud sellenet committed Apr 07, 2014
commit ab1829e0cfc83e1e290d5fcbff29fbdff6f04958
Showing 4 changed files with 0 additions and 390 deletions
spec/integration/server/basic_spec.rb +0 -168
@@ @@ -1,168 +0,0 @@
- # encoding: utf-8
-
- require File.dirname(__FILE__) + '/../integration_helper'
- require 'locomotive/steam/server'
- require 'rack/test'
-
- describe Locomotive::Steam::Server do
-
- include Rack::Test::Methods
-
- def app
- run_server
- end
-
- it 'shows the index page' do
- get '/index'
- last_response.body.should =~ /Upcoming events/
- end
-
- it 'shows the 404 page' do
- get '/void'
- last_response.status.should eq(404)
- last_response.body.should =~ /page not found/
- end
-
- it 'shows the 404 page with 200 status code when its called explicitly' do
- get '/404'
- last_response.status.should eq(200)
- last_response.body.should =~ /page not found/
- end
-
- it 'shows content' do
- get '/about-us/jane-doe'
- last_response.body.should =~ /Lorem ipsum dolor sit amet/
- end
-
- it 'shows a content type template ' do
- get '/songs/song-number-1'
- last_response.body.should =~ /Song #1/
- end
-
- it 'renders a page under a templatized one' do
- get '/songs/song-number-1/band'
- last_response.body.should =~ /Song #1/
- last_response.body.should =~ /Leader: Eddie/
- end
-
- it 'translates strings' do
- get '/en'
- last_response.body.should =~ /Powered by/
- get '/fr'
- last_response.body.should =~ /Propulsé par/
- get '/nb'
- last_response.body.should_not =~ /Powered by/
- end
-
- it 'provides translation in scopes' do
- get '/'
- last_response.body.should =~ /scoped_translation=.French./
- end
-
- it 'translates a page with link_to tags inside' do
- get '/fr/notre-musique'
- last_response.body.should =~ /<h3><a href="\/fr\/songs\/song-number-8">Song #8<\/a><\/h3>/
- last_response.body.should =~ /Propulsé par/
- end
-
- it 'returns all the pages' do
- get '/all'
- last_response.body.should =~ /Home page/
- last_response.body.should =~ /<li>Home page<\/li>/
- last_response.body.should =~ /<li>John-doe<\/li>/
- last_response.body.should =~ /<li>Songs<\/li>/
- last_response.body.should =~ /<li>A song template<\/li>/
- end
-
- describe 'snippets' do
-
- it 'includes a basic snippet' do
- get '/'
- last_response.body.should =~ /All photos are licensed under Creative Commons\./
- end
-
- it 'includes a snippet whose name is composed of dash' do
- get '/'
- last_response.body.should =~ /<p>A complicated one name indeed.<\/p>/
- end
-
- end
-
- describe 'nav' do
-
- subject { get '/all'; last_response.body }
-
- it { should_not match(/<nav id="nav">/) }
-
- it { should match(/<li id="about-us-link" class="link first"><a href="\/about-us">About Us<\/a><\/li>/) }
-
- it { should match(/<li id="music-link" class="link"><a href="\/music">Music<\/a><\/li>/) }
-
- it { should match(/<li id="store-link" class="link"><a href="\/store">Store<\/a><\/li>/) }
-
- it { should match(/<li id="contact-link" class="link last"><a href="\/contact">Contact Us<\/a><\/li>/) }
-
- it { should_not match(/<li id="events-link" class="link"><a href="\/events">Events<\/a><\/li>/) }
-
- describe 'with wrapper' do
-
- subject { get '/tags/nav'; last_response.body }
-
- it { should match(/<nav id="nav">/) }
-
- end
-
- describe 'very deep' do
-
- subject { get '/tags/nav_in_deep'; last_response.body }
-
- it { should match(/<li id=\"john-doe-link\" class=\"link first last\">/) }
-
- end
-
- end
-
- describe 'contents with_scope' do
- subject { get '/grunge_bands'; last_response.body }
-
- it { should match(/Layne/)}
- it { should_not match(/Peter/) }
- end
-
- describe "pages with_scope" do
- subject { get '/unlisted_pages'; last_response.body }
- it { subject.should match(/Page to test the nav tag/)}
- it { should_not match(/About Us/)}
- end
-
- describe 'theme assets' do
-
- subject { get '/all'; last_response.body }
-
- it { should match(/<link href="\/stylesheets\/application.css" media="screen" rel="stylesheet" type="text\/css" \/>/) }
-
- it { should match(/<script src="\/javascripts\/application.js" type='text\/javascript'><\/script>/) }
-
- it { should match(/<link rel="alternate" type="application\/atom\+xml" title="A title" href="\/foo\/bar" \/>/) }
-
- end
-
- describe 'session' do
-
- subject { get '/contest'; last_response.body }
-
- it { should match(/Your code is: HELLO WORLD/) }
- it { should_not match(/You've already participated to that contest ! Come back later./) }
-
- describe 'assign tag' do
-
- subject { 2.times { get '/contest' }; last_response.body }
-
- it { should_not match(/Your code is: HELLO WORLD/) }
- it { should match(/You've already participated to that contest ! Come back later./) }
-
- end
-
- end
-
- end
\ No newline at end of file
spec/integration/server/contact_form_spec.rb +0 -111
@@ @@ -1,111 +0,0 @@
- # encoding: utf-8
-
- require File.dirname(__FILE__) + '/../integration_helper'
- require 'locomotive/steam/server'
- require 'rack/test'
-
- describe 'ContactForm' do
-
- include Rack::Test::Methods
-
- def app
- run_server
- end
-
- it 'renders the form' do
- get '/contact'
- last_response.body.should =~ /\/entry_submissions\/messages.json/
- end
-
- describe '#submit' do
-
- let(:params) { {
- 'entry' => { 'name' => 'John', 'email' => 'j@doe.net', 'message' => 'Bla bla' },
- 'success_callback' => '/events',
- 'error_callback' => '/contact' } }
- let(:response) { post_contact_form(params, false) }
- let(:status) { response.status }
-
- describe 'with json request' do
-
- let(:response) { post_contact_form(params, true) }
- let(:entry) { JSON.parse(response.body)['message'] }
-
- context 'when not valid' do
-
- let(:params) { {} }
-
- it 'returns an error status' do
- response.status.should == 422
- end
-
- describe 'errors' do
-
- subject { entry['errors'] }
-
- it { should have_key_with_value('name', "can't not be blank") }
-
- it { should have_key_with_value('email', "can't not be blank") }
-
- it { should have_key_with_value('message', "can't not be blank") }
-
- end
-
- end
-
- context 'when valid' do
-
- it 'returns a success status' do
- response.status.should == 200
- end
-
- end
-
- end
-
- describe 'with html request' do
-
- context 'when not valid' do
-
- let(:params) { { 'error_callback' => '/contact' } }
-
- it 'returns a success status' do
- response.status.should == 200
- end
-
- it 'displays errors' do
- response.body.to_s.should =~ /can't not be blank/
- end
-
- end
-
- context 'when valid' do
-
- let(:response) { post_contact_form(params, false, true) }
-
- it 'returns a success status' do
- response.status.should == 200
- end
-
- it 'displays a success message' do
- response.body.should =~ /Thank you John/
- end
-
- end
-
- end
-
- end
-
- def post_contact_form(params, json = false, follow_redirect = false)
- url = '/entry_submissions/messages'
- url += '.json' if json
- params = params.symbolize_keys if json
- post url, params
- if follow_redirect
- follow_redirect!
- end
- last_response
- end
-
- end
spec/integration/server/liquid_spec.rb +0 -91
@@ @@ -1,91 +0,0 @@
- # encoding: utf-8
-
- require File.dirname(__FILE__) + '/../integration_helper'
- require 'locomotive/steam/server'
- require 'rack/test'
-
- describe Locomotive::Steam::Server do
-
- include Rack::Test::Methods
-
- def app
- run_server
- end
-
- it "converts {{ page.templatized? }} => true on templatized page" do
- get '/songs/song-number-1'
- last_response.body.should =~ /templatized=.true./
- end
-
- it "converts {{ page.templatized? }} => false on regular page" do
- get '/index'
- last_response.body.should =~ /templatized=.false./
- end
-
- it "converts {{ page.listed? }} => true on listed page" do
- get '/music'
- last_response.body.should =~ /listed=.true./
- end
-
- it "provides an access to page's content_type collection" do
- get '/songs/song-number-1'
- last_response.body.should =~ /content_type_size=.8./
- end
-
- it "provides count alias on collections" do
- get '/songs/song-number-1'
- last_response.body.should =~ /content_type_count=.8./
- end
-
- describe '.link_to' do
-
- it "writes a link to a page" do
- get '/events'
- last_response.body.should =~ /Discover: <a href="\/music">Music<\/a>/
- end
-
- it "writes a localized a link" do
- get '/events'
- last_response.body.should =~ /Plus à notre sujet: <a href="\/fr\/a-notre-sujet">Qui sommes nous \?<\/a>/
- end
-
- it "writes a link to a page with a custom label" do
- get '/events'
- last_response.body.should =~ /More about us: <a href="\/about-us">Who are we \?<\/a>/
- end
-
- it "writes a link to a templatized page" do
- get '/events'
- last_response.body.should =~ /<a href="\/songs\/song-number-1">Song #1<\/a>/
- end
-
- it "writes a link to a templatized page with a different handle" do
- get '/events'
- last_response.body.should =~ /<a href="\/songs\/song-number-8">Song #8<\/a>/
- end
-
- end
-
- describe 'scope & assigns' do
-
- it "evaluates collection when called all inside of scope" do
- get '/music'
- last_response.body.should =~ /<p class=.scoped_song.>Song #3/
- last_response.body.should =~ /<p class=.scoped_song_link.>\s+<a href=.\/songs\/song-number-3.>Song #3/m
- end
-
- it "size of evaluated unscoped collection equal to unevaluated one" do
- get '/music'
- last_response.body.should =~ /class=.collection_equality.>8=8/
- end
-
- end
-
- describe 'html helpers' do
- it 'bypass url for css resource' do
- get '/'
- last_response.body.should =~ /<link href=("|')http:\/\/fonts\.googleapis\.com\/css\?family=Open\+Sans:400,700("|')/
- end
- end
-
- end
\ No newline at end of file
spec/integration/server/with_scope_spec.rb +0 -20
@@ @@ -1,20 +0,0 @@
- # encoding: utf-8
-
- require File.dirname(__FILE__) + '/../integration_helper'
- require 'locomotive/steam/server'
- require 'rack/test'
-
- describe 'Complex with_scope conditions' do
-
- include Rack::Test::Methods
-
- def app
- run_server
- end
-
- it 'returns the right number of events' do
- get '/filtered'
- last_response.body.should =~ /events=1./
- end
-
- end
\ No newline at end of file