Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #52 from alphagov/bump-plek-rebased

Bump plek rebased
  • Loading branch information...
commit a8eb8ccbb1ac4a250b967a63a84d30e54c488e73 2 parents d5b95f5 + d8543b1
@fatbusinessman fatbusinessman authored
View
2  Gemfile
@@ -3,7 +3,7 @@ source 'https://gems.gemfury.com/vo6ZrmjBQu5szyywDszE/'
gem 'gds-warmup-controller', '0.1.0'
-gem 'plek', '~> 0.3.0'
+gem 'plek', '1.0.0'
gem 'formtastic', git: 'https://github.com/justinfrench/formtastic.git', branch: '2.1-stable'
gem 'formtastic-bootstrap', git: 'https://github.com/cgunther/formtastic-bootstrap.git', branch: 'bootstrap-2'
gem 'ansi'
View
4 Gemfile.lock
@@ -210,7 +210,7 @@ GEM
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
- plek (0.3.0)
+ plek (1.0.0)
builder
polyglot (0.3.3)
rack (1.4.3)
@@ -335,7 +335,7 @@ DEPENDENCIES
mongoid_rails_migrations (= 1.0.0)
nokogiri
null_logger
- plek (~> 0.3.0)
+ plek (= 1.0.0)
rails (= 3.2.11)
router-client (= 3.1.0)
rummageable (~> 0.3.0)
View
2  Rakefile
@@ -3,6 +3,8 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
ENV["COVERAGE"] = "true"
+ENV["GOVUK_APP_DOMAIN"] = ENV.fetch("GOVUK_APP_DOMAIN", "dev.gov.uk")
+ENV["GOVUK_WEBSITE_ROOT"] = ENV.fetch("GOVUK_WEBSITE_ROOT", "http://www.dev.gov.uk")
require File.expand_path('../config/application', __FILE__)
Panopticon::Application.load_tasks
View
2  app/helpers/artefacts_helper.rb
@@ -4,7 +4,7 @@ def need_url(artefact)
end
def published_url(artefact)
- Plek.current.find('www') + "/#{artefact.slug}"
+ ENV['GOVUK_WEBSITE_ROOT'] + "/#{artefact.slug}"
end
def human_timestamp(timestamp)
View
6 features/support/registration_info.rb
@@ -1,6 +1,6 @@
module RegistrationInfo
- SEARCH_ROOT = "http://search.test.gov.uk"
+ SEARCH_ROOT = "http://search.dev.gov.uk"
ROUTER_ROOT = "http://router.cluster:8080"
def example_smart_answer
@@ -56,7 +56,7 @@ def stub_search
def stub_router(artefact = nil)
WebMock.stub_request(:put, %r{^#{ROUTER_ROOT}/router/applications/.*$}).
- with(:body => { "backend_url" => %r{^.*.test.gov.uk$} }).
+ with(:body => { "backend_url" => %r{^.*\.dev\.gov\.uk$} }).
to_return(:status => 200, :body => "{}", :headers => {})
# catch-all
@@ -74,7 +74,7 @@ def stub_router(artefact = nil)
def stub_search_delete
@fake_search_delete = WebMock.stub_request(:delete, artefact_search_url(@artefact)).to_return(status: 200)
- WebMock.stub_request(:post, "http://search.test.gov.uk/commit")
+ WebMock.stub_request(:post, "http://search.dev.gov.uk/commit")
.to_return(:status => 200)
end
View
1  jenkins.sh
@@ -1,5 +1,4 @@
#!/bin/bash -x
-export RAILS_ENV=test
bundle install --path "${HOME}/bundles/${JOB_NAME}" --deployment
bundle exec rake db:drop db:create db:schema:load
bundle exec rake
View
4 test/functional/artefacts_controller_test.rb
@@ -282,9 +282,9 @@ class ArtefactsControllerTest < ActionController::TestCase
setup do
WebMock.stub_request(:delete, "http://router.cluster:8080/router/routes/whatever").
to_return(:status => 200)
- WebMock.stub_request(:delete, "http://search.test.gov.uk/documents/%2Fwhatever").
+ WebMock.stub_request(:delete, "http://search.dev.gov.uk/documents/%2Fwhatever").
to_return(:status => 200)
- WebMock.stub_request(:post, "http://search.test.gov.uk/commit").
+ WebMock.stub_request(:post, "http://search.dev.gov.uk/commit").
to_return(:status => 200)
end
View
2  test/integration/artefacts_edit_test.rb
@@ -12,7 +12,7 @@ class ArtefactsEditTest < ActionDispatch::IntegrationTest
visit "/artefacts"
click_on "Alpha"
- assert page.has_link?("View on site", :href => "http://www.test.gov.uk/alpha")
+ assert page.has_link?("View on site", :href => "http://www.dev.gov.uk/alpha")
end
context "editing legacy_sources" do
View
6 test/integration/artefacts_index_test.rb
@@ -13,9 +13,9 @@ class ArtefactsIndexTest < ActionDispatch::IntegrationTest
visit "/artefacts"
- assert page.has_link?("alpha", :href => "http://www.test.gov.uk/alpha")
- assert page.has_link?("bravo", :href => "http://www.test.gov.uk/bravo")
- assert page.has_link?("charlie", :href => "http://www.test.gov.uk/charlie")
+ assert page.has_link?("alpha", :href => "http://www.dev.gov.uk/alpha")
+ assert page.has_link?("bravo", :href => "http://www.dev.gov.uk/bravo")
+ assert page.has_link?("charlie", :href => "http://www.dev.gov.uk/charlie")
end
should "display the language for the artefact" do
View
8 test/unit/routable_artefact_test.rb
@@ -8,7 +8,7 @@ class RoutableArtefactTest < ActiveSupport::TestCase
context "registering the application" do
should "ensure that the application exists in the router" do
- Router.any_instance.expects(:update_application).with("bee", "bee.test.gov.uk")
+ Router.any_instance.expects(:update_application).with("bee", "bee.dev.gov.uk")
Router.any_instance.stubs(:create_route)
@routable.submit
end
@@ -16,9 +16,9 @@ class RoutableArtefactTest < ActiveSupport::TestCase
should "strip the scheme from the URL returned by Plek" do
# Plek returns the external URL's for applications, this is the HTTPS version
# in preview and production. If an https URL is passed to the router, it gets confused.
- Plek.any_instance.stubs(:find).with('bee').returns("https://bee.test.gov.uk")
+ Plek.any_instance.stubs(:find).with('bee').returns("https://bee.dev.gov.uk")
- Router.any_instance.expects(:update_application).with("bee", "bee.test.gov.uk")
+ Router.any_instance.expects(:update_application).with("bee", "bee.dev.gov.uk")
Router.any_instance.stubs(:create_route)
@routable.submit
end
@@ -74,7 +74,7 @@ class RoutableArtefactTest < ActiveSupport::TestCase
should "use the internal hostname for frontend" do
# Was previously using the publically visible hostname (www...) which was breaking things.
- Plek.stubs(:current_env).returns('production')
+ Plek.any_instance.stubs('find').with('frontend').returns("https://frontend.production.alphagov.co.uk")
@artefact.update_attributes!(:owning_app => 'frontend')
Router.any_instance.expects(:update_application).with("frontend", "frontend.production.alphagov.co.uk")
Router.any_instance.stubs(:create_route)
Please sign in to comment.
Something went wrong with that request. Please try again.