Merge branch 'master' into develop
This commit is contained in:
commit
530b534c42
4 changed files with 29 additions and 6 deletions
10
Gemfile.lock
10
Gemfile.lock
|
|
@ -1,17 +1,17 @@
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
diaspora_federation (0.0.11)
|
diaspora_federation (0.0.12)
|
||||||
faraday (~> 0.9.0)
|
faraday (~> 0.9.0)
|
||||||
faraday_middleware (~> 0.10.0)
|
faraday_middleware (~> 0.10.0)
|
||||||
nokogiri (~> 1.6, >= 1.6.7.2)
|
nokogiri (~> 1.6, >= 1.6.7.2)
|
||||||
typhoeus (~> 1.0)
|
typhoeus (~> 1.0)
|
||||||
valid (~> 1.0)
|
valid (~> 1.0)
|
||||||
diaspora_federation-rails (0.0.11)
|
diaspora_federation-rails (0.0.12)
|
||||||
diaspora_federation (= 0.0.11)
|
diaspora_federation (= 0.0.12)
|
||||||
rails (~> 4.2)
|
rails (~> 4.2)
|
||||||
diaspora_federation-test (0.0.11)
|
diaspora_federation-test (0.0.12)
|
||||||
diaspora_federation (= 0.0.11)
|
diaspora_federation (= 0.0.12)
|
||||||
factory_girl (~> 4.5, >= 4.5.0)
|
factory_girl (~> 4.5, >= 4.5.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
# Base-Controller for all DiasporaFederation-Controller
|
# Base-Controller for all DiasporaFederation-Controller
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
before_action :set_locale
|
||||||
|
|
||||||
|
# Fix locale leakage from other requests.
|
||||||
|
# Set "en" as locale for every federation request.
|
||||||
|
def set_locale
|
||||||
|
I18n.locale = :en
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
module DiasporaFederation
|
module DiasporaFederation
|
||||||
# the gem version
|
# the gem version
|
||||||
VERSION = "0.0.11".freeze
|
VERSION = "0.0.12".freeze
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
module DiasporaFederation
|
||||||
|
describe ApplicationController, type: :controller do
|
||||||
|
controller do
|
||||||
|
def index
|
||||||
|
head :ok
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#set_locale" do
|
||||||
|
it "sets the default locale" do
|
||||||
|
expect(I18n).to receive(:locale=).with(:en)
|
||||||
|
get :index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue