-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert helper specs to request specs
as the new api involves content_for :javscripts
- Loading branch information
Phil Lee
committed
Jul 16, 2014
1 parent
c2f1645
commit 16efe8a
Showing
7 changed files
with
45 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
class FrontendController < ApplicationController | ||
def index | ||
end | ||
|
||
def with_config | ||
end | ||
|
||
def without_config | ||
end | ||
|
||
def called_twice | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= zendesk_feedback_tab({en: {id: 1, url: 2}}) + zendesk_feedback_tab({en: {id: 1, url: 2}}) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= zendesk_feedback_tab({en: {id: 1, url: 2}}) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= zendesk_feedback_tab(nil) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Rails.application.routes.draw do | ||
scope "/:locale", :locale => /en|cy/ do | ||
get '/frontend', to: 'frontend#index', format: false | ||
get '/frontend/with_config', to: 'frontend#with_config' | ||
get '/frontend/without_config', to: 'frontend#without_config' | ||
get '/frontend/called_twice', to: 'frontend#called_twice' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Feedback', type: :request do | ||
context 'when config is present' do | ||
it 'includes dropbox id' do | ||
get '/en/frontend/with_config' | ||
expect(response.body).to match(/dropboxID\:\s*"1"/) | ||
end | ||
|
||
it 'includes the dropbox url' do | ||
get '/en/frontend/with_config' | ||
expect(response.body).to match(/url\:\s*"2"/) | ||
end | ||
end | ||
|
||
context "config is blank" do | ||
it 'does not include script' do | ||
get '/en/frontend/without_config' | ||
expect(response.body).to_not include('script') | ||
end | ||
end | ||
|
||
context 'called twice' do | ||
it 'should not initialize twice' do | ||
get '/en/frontend/called_twice' | ||
|
||
expect(response.body).to_not match(/dropboxID\:\s*"1".*dropboxID\:\s*"1"/) | ||
expect(response.body).to_not match(/url\:\s*"2".*url\:\s*"2"/) | ||
end | ||
end | ||
end |