File tree Expand file tree Collapse file tree
phraseapp-in-context-editor-ruby
spec/phraseapp-in-context-editor-ruby Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ def enabled?
4848 def disabled?
4949 !config . enabled
5050 end
51+
52+ def origin
53+ config . origin
54+ end
5155 end
5256
5357 def self . configure
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ class Config
88 enabled : false ,
99 backend : PhraseApp ::InContextEditor ::BackendService . new ,
1010 prefix : "{{__" ,
11- suffix : "__}}"
11+ suffix : "__}}" ,
12+ origin : "in-context-editor-ruby"
1213 } . freeze
1314
1415 CONFIG_OPTIONS . each do |option , default_value |
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ def load_in_context_editor(opts = {})
1717 "accountId" => PhraseApp ::InContextEditor . account_id ,
1818 "datacenter" => PhraseApp ::InContextEditor . datacenter ,
1919 "prefix" => PhraseApp ::InContextEditor . prefix ,
20- "suffix" => PhraseApp ::InContextEditor . suffix
20+ "suffix" => PhraseApp ::InContextEditor . suffix ,
21+ "origin" => PhraseApp ::InContextEditor . origin
2122 } . merge ( opts )
2223
2324 snippet = <<-EOS
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ class Helpers
3737 it { is_expected . to include ( "\" suffix\" :\" __]]\" " ) }
3838 end
3939
40+ describe "origin setting" do
41+ it { is_expected . to include ( "\" origin\" :\" in-context-editor-ruby\" " ) }
42+ end
43+
4044 describe "overriding options" do
4145 let ( :opts ) { { prefix : "__%%" } }
4246 before ( :each ) { PhraseApp ::InContextEditor . config . prefix = "__]]" }
You can’t perform that action at this time.
0 commit comments