localeapp 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,21 +20,21 @@ describe I18n::Backend::Base, '#default' do
20
20
  describe "when subject is a String" do
21
21
  it "adds translations to missing translations to send to Locale" do
22
22
  allow_sending do
23
- Localeapp.missing_translations.should_receive(:add).with(:en, 'foo', 'bar', :baz => 'bam')
23
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'foo', 'bar', :baz => 'bam')
24
24
  klass.default(:en, 'foo', 'bar', :baz => 'bam')
25
25
  end
26
26
  end
27
27
 
28
28
  it "strips the subject when the translation is not in the default locale" do
29
29
  allow_sending do
30
- Localeapp.missing_translations.should_receive(:add).with(:fr, 'foo', nil, :baz => 'bam')
30
+ expect(Localeapp.missing_translations).to receive(:add).with(:fr, 'foo', nil, :baz => 'bam')
31
31
  klass.default(:fr, 'foo', 'bar', :baz => 'bam')
32
32
  end
33
33
  end
34
34
 
35
35
  it "adds translations to missing translations when using a string as the locale" do
36
36
  allow_sending do
37
- Localeapp.missing_translations.should_receive(:add).with('en', 'foo', 'bar', :baz => 'bam')
37
+ expect(Localeapp.missing_translations).to receive(:add).with('en', 'foo', 'bar', :baz => 'bam')
38
38
  klass.default('en', 'foo', 'bar', :baz => 'bam')
39
39
  end
40
40
  end
@@ -45,7 +45,7 @@ describe I18n::Backend::Base, '#default' do
45
45
  describe "and there is a text inside the array" do
46
46
  it "add translations to missing translations to send to Locale" do
47
47
  allow_sending do
48
- Localeapp.missing_translations.should_receive(:add).with(:en, 'foo', 'correct default', :baz => 'bam')
48
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'foo', 'correct default', :baz => 'bam')
49
49
  klass.default(:en, 'foo', [:missing, 'correct default'], :baz => 'bam')
50
50
  end
51
51
  end
@@ -54,8 +54,8 @@ describe I18n::Backend::Base, '#default' do
54
54
  describe "and there is not a text inside the array" do
55
55
  it "doesn't send anything to Locale" do
56
56
  allow_sending do
57
- Localeapp.missing_translations.should_not_receive(:add)
58
- I18n.stub(:translate) do |subject, _|
57
+ expect(Localeapp.missing_translations).not_to receive(:add)
58
+ allow(I18n).to receive(:translate) do |subject, _|
59
59
  subject == :not_missing ? "not missing" : nil
60
60
  end
61
61
  klass.default(:en, 'foo', [:missing, :not_missing], :baz => 'bam')
@@ -67,7 +67,7 @@ describe I18n::Backend::Base, '#default' do
67
67
  describe "when subject is a Symbol" do
68
68
  it "doesn't send anything to Locale" do
69
69
  allow_sending do
70
- Localeapp.missing_translations.should_not_receive(:add)
70
+ expect(Localeapp.missing_translations).not_to receive(:add)
71
71
  klass.default(:en, 'foo', :other_key, :baz => 'bam')
72
72
  end
73
73
  end
@@ -77,7 +77,7 @@ describe I18n::Backend::Base, '#default' do
77
77
  i18n = I18nWithFallbacks.new
78
78
 
79
79
  with_configuration(:sending_environments => ['my_env'], :environment_name => 'my_env' ) do
80
- Localeapp.missing_translations.should_receive(:add).with(:en, 'my.object', 'my default', {:default => 'my default'})
80
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'my.object', 'my default', {:default => 'my default'})
81
81
  i18n.translate(:en, 'my.object', :default => 'my default')
82
82
  end
83
83
  end
@@ -9,24 +9,24 @@ describe Localeapp::ExceptionHandler, '#call(exception, locale, key, options)' d
9
9
  end
10
10
 
11
11
  it "adds the missing translation to the missing translation list" do
12
- Localeapp.missing_translations.should_receive(:add).with(:en, 'foo', nil, { :baz => 'bam' })
12
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'foo', nil, { :baz => 'bam' })
13
13
  I18n.t('foo', :baz => 'bam')
14
14
  end
15
15
 
16
16
  it "handles when the key is an array of keys" do
17
- Localeapp.missing_translations.should_receive(:add).with(:en, 'foo', nil, {})
18
- Localeapp.missing_translations.should_receive(:add).with(:en, 'bar', nil, {})
17
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'foo', nil, {})
18
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, 'bar', nil, {})
19
19
  I18n.t(['foo', 'bar'])
20
20
  end
21
21
 
22
22
  it "handles when the default is a Symbol that can be resolved" do
23
23
  I18n.backend.store_translations(:en, {:default_symbol_test => 'is resolved'})
24
- Localeapp.missing_translations.should_not_receive(:add)
25
- I18n.t(:foo, :default => :default_symbol_test).should == 'is resolved'
24
+ expect(Localeapp.missing_translations).not_to receive(:add)
25
+ expect(I18n.t(:foo, :default => :default_symbol_test)).to eq('is resolved')
26
26
  end
27
27
 
28
28
  it "handles when the default is a Symbol that can't be resolved" do
29
- Localeapp.missing_translations.should_receive(:add).with(:en, :foo, nil, {:default => :bar})
29
+ expect(Localeapp.missing_translations).to receive(:add).with(:en, :foo, nil, {:default => :bar})
30
30
  I18n.t(:foo, :default => :bar)
31
31
  end
32
32
 
@@ -6,7 +6,7 @@ describe Localeapp::KeyChecker, "#check(key)" do
6
6
  with_configuration do
7
7
  @checker = Localeapp::KeyChecker.new
8
8
  end
9
- @checker.check('TEST_KEY').should == [false, {}]
9
+ expect(@checker.check('TEST_KEY')).to eq([false, {}])
10
10
  end
11
11
 
12
12
  it "returns true and and the parsed json hash if the response from locale app is a 200" do
@@ -14,6 +14,6 @@ describe Localeapp::KeyChecker, "#check(key)" do
14
14
  with_configuration do
15
15
  @checker = Localeapp::KeyChecker.new
16
16
  end
17
- @checker.check('TEST_KEY').should == [true, valid_project_data]
17
+ expect(@checker.check('TEST_KEY')).to eq([true, valid_project_data])
18
18
  end
19
19
  end
@@ -5,17 +5,17 @@ describe Localeapp::MissingTranslations, "#add(locale, key, description = nil, o
5
5
  it "stores the missing translation data" do
6
6
  translations = Localeapp::MissingTranslations.new
7
7
  translations.add(:en, 'foo', 'bar', { :baz => 'bam' })
8
- translations[:en].should include('foo')
9
- translations[:en]['foo'].description.should == 'bar'
10
- translations[:en]['foo'].options.should == { :baz => 'bam' }
8
+ expect(translations[:en]).to include('foo')
9
+ expect(translations[:en]['foo'].description).to eq('bar')
10
+ expect(translations[:en]['foo'].options).to eq({ :baz => 'bam' })
11
11
  end
12
12
 
13
13
  it "respects I18n options when constructing a key" do
14
14
  translations = Localeapp::MissingTranslations.new
15
15
  translations.add(:en, 'foo', nil, { :scope => 'bar', :baz => 'bam' })
16
16
 
17
- translations[:en].should include('bar.foo')
18
- translations[:en]['bar.foo'].options.should == { :baz => 'bam' }
17
+ expect(translations[:en]).to include('bar.foo')
18
+ expect(translations[:en]['bar.foo'].options).to eq({ :baz => 'bam' })
19
19
  end
20
20
  end
21
21
 
@@ -26,26 +26,26 @@ describe Localeapp::MissingTranslations, "#to_send" do
26
26
  translations.add(:es, 'bar', 'baz')
27
27
 
28
28
  to_send = translations.to_send
29
- to_send.size.should == 2
30
- to_send[0][:key].should == 'foo'
31
- to_send[0][:locale].should == :en
32
- to_send[0].should_not have_key(:description)
33
- to_send[0][:options].should == { :baz => 'bam' }
34
- to_send[1][:key].should == 'bar'
35
- to_send[1][:locale].should == :es
36
- to_send[1][:description].should == 'baz'
37
- to_send[1][:options].should == {}
29
+ expect(to_send.size).to eq(2)
30
+ expect(to_send[0][:key]).to eq('foo')
31
+ expect(to_send[0][:locale]).to eq(:en)
32
+ expect(to_send[0]).not_to have_key(:description)
33
+ expect(to_send[0][:options]).to eq({ :baz => 'bam' })
34
+ expect(to_send[1][:key]).to eq('bar')
35
+ expect(to_send[1][:locale]).to eq(:es)
36
+ expect(to_send[1][:description]).to eq('baz')
37
+ expect(to_send[1][:options]).to eq({})
38
38
  end
39
39
 
40
40
  it "doesn't send the same key twice when cache_missing_translations is true" do
41
41
  with_configuration(:cache_missing_translations => true) do
42
42
  translation_a = Localeapp::MissingTranslations.new
43
43
  translation_a.add(:es, 'foobybar')
44
- translation_a.to_send.size.should == 1
44
+ expect(translation_a.to_send.size).to eq(1)
45
45
 
46
46
  translation_b = Localeapp::MissingTranslations.new
47
47
  translation_b.add(:en, 'foobybar')
48
- translation_a.to_send.size.should == 0
48
+ expect(translation_a.to_send.size).to eq(0)
49
49
  end
50
50
  end
51
51
 
@@ -53,11 +53,11 @@ describe Localeapp::MissingTranslations, "#to_send" do
53
53
  with_configuration(:cache_missing_translations => false) do
54
54
  translation_a = Localeapp::MissingTranslations.new
55
55
  translation_a.add(:es, 'foobybar')
56
- translation_a.to_send.size.should == 1
56
+ expect(translation_a.to_send.size).to eq(1)
57
57
 
58
58
  translation_b = Localeapp::MissingTranslations.new
59
59
  translation_b.add(:en, 'foobybar')
60
- translation_a.to_send.size.should == 1
60
+ expect(translation_a.to_send.size).to eq(1)
61
61
  end
62
62
  end
63
63
  end
@@ -16,11 +16,11 @@ describe Localeapp::Poller do
16
16
  describe "#needs_reloading?" do
17
17
  it "returns true when updated_at has been changed in the synchronization file" do
18
18
  @poller.write_synchronization_data!(@poller.polled_at, 12345)
19
- @poller.needs_reloading?.should be_true
19
+ expect(@poller.needs_reloading?).to be true
20
20
  end
21
21
 
22
22
  it "returns false when updated_at is the same as in the synchronization file" do
23
- @poller.needs_reloading?.should be_false
23
+ expect(@poller.needs_reloading?).to be false
24
24
  end
25
25
  end
26
26
 
@@ -49,17 +49,17 @@ describe Localeapp::Poller do
49
49
  end
50
50
 
51
51
  it "returns false" do
52
- @poller.poll!.should == false
52
+ expect(@poller.poll!).to eq(false)
53
53
  end
54
54
 
55
55
  it "updates the polled_at but not the updated_at synchronization data" do
56
- @poller.stub(:current_time).and_return(polled_at_time)
57
- @poller.should_receive(:write_synchronization_data!).with(polled_at_time, @updated_at)
56
+ allow(@poller).to receive(:current_time).and_return(polled_at_time)
57
+ expect(@poller).to receive(:write_synchronization_data!).with(polled_at_time, @updated_at)
58
58
  @poller.poll!
59
59
  end
60
60
 
61
61
  it "updates the synchronization data" do
62
- @poller.should_receive(:write_synchronization_data!)
62
+ expect(@poller).to receive(:write_synchronization_data!)
63
63
  @poller.poll!
64
64
  end
65
65
  end
@@ -70,11 +70,11 @@ describe Localeapp::Poller do
70
70
  end
71
71
 
72
72
  it "returns false" do
73
- @poller.poll!.should == false
73
+ expect(@poller.poll!).to eq(false)
74
74
  end
75
75
 
76
76
  it "doesn't update the synchronization data" do
77
- @poller.should_not_receive(:write_synchronization_data!)
77
+ expect(@poller).not_to receive(:write_synchronization_data!)
78
78
  @poller.poll!
79
79
  end
80
80
  end
@@ -90,18 +90,18 @@ describe Localeapp::Poller do
90
90
  end
91
91
 
92
92
  it "returns true" do
93
- @poller.poll!.should == true
93
+ expect(@poller.poll!).to eq(true)
94
94
  end
95
95
 
96
96
  it "updates the polled_at and the updated_at synchronization data" do
97
- @poller.stub(:current_time).and_return(polled_at_time)
98
- @poller.should_receive(:write_synchronization_data!).with(polled_at_time, updated_at_time)
97
+ allow(@poller).to receive(:current_time).and_return(polled_at_time)
98
+ expect(@poller).to receive(:write_synchronization_data!).with(polled_at_time, updated_at_time)
99
99
  @poller.poll!
100
100
  end
101
101
 
102
102
  it "passes the data through to the Updater" do
103
103
  FakeWeb.register_uri(:get, "https://api.localeapp.com/v1/projects/TEST_KEY/translations.yml?updated_at=#{@updated_at}", :body => @hash.to_yaml, :status => ['200', 'OK'], :date => Time.now.httpdate)
104
- Localeapp.updater.should_receive(:update).with(@hash)
104
+ expect(Localeapp.updater).to receive(:update).with(@hash)
105
105
  @poller.poll!
106
106
  end
107
107
  end
@@ -19,7 +19,7 @@ describe Localeapp::Rails::Controller, '#handle_translation_updates' do
19
19
  with_configuration(configuration) do
20
20
  @controller = TestController.new
21
21
  end
22
- now = Time.now; Time.stub(:now).and_return(now)
22
+ now = Time.now; allow(Time).to receive(:now).and_return(now)
23
23
  end
24
24
 
25
25
  after do
@@ -33,12 +33,12 @@ describe Localeapp::Rails::Controller, '#handle_translation_updates' do
33
33
 
34
34
  it "calls poller.poll! when the synchronization file's polled_at has changed" do
35
35
  Localeapp.poller.write_synchronization_data!(01234, 56789)
36
- Localeapp.poller.should_receive(:poll!)
36
+ expect(Localeapp.poller).to receive(:poll!)
37
37
  @controller.handle_translation_updates
38
38
  end
39
39
 
40
40
  it "doesn't call poller.poll! when the synchronization file's polled_at is the same" do
41
- Localeapp.poller.should_not_receive(:poll!)
41
+ expect(Localeapp.poller).not_to receive(:poll!)
42
42
  @controller.handle_translation_updates
43
43
  end
44
44
  end
@@ -50,12 +50,12 @@ describe Localeapp::Rails::Controller, '#handle_translation_updates' do
50
50
 
51
51
  it "doesn't poller.poll! when the synchronization file's polled_at has changed" do
52
52
  Localeapp.poller.write_synchronization_data!(01234, 56789)
53
- Localeapp.poller.should_not_receive(:poll!)
53
+ expect(Localeapp.poller).not_to receive(:poll!)
54
54
  @controller.handle_translation_updates
55
55
  end
56
56
 
57
57
  it "doesn't poller.poll! when the synchronization file's polled_at is the same" do
58
- Localeapp.poller.should_not_receive(:poll!)
58
+ expect(Localeapp.poller).not_to receive(:poll!)
59
59
  @controller.handle_translation_updates
60
60
  end
61
61
  end
@@ -63,17 +63,17 @@ describe Localeapp::Rails::Controller, '#handle_translation_updates' do
63
63
  context "when reloading is enabled" do
64
64
  before do
65
65
  Localeapp.configuration.environment_name = 'development'
66
- Localeapp.poller.stub(:poll!)
66
+ allow(Localeapp.poller).to receive(:poll!)
67
67
  end
68
68
 
69
69
  it "calls I18n.reload! when the synchronization file's updated_at has changed" do
70
70
  Localeapp.poller.write_synchronization_data!(01234, 56789)
71
- I18n.should_receive(:reload!)
71
+ expect(I18n).to receive(:reload!)
72
72
  @controller.handle_translation_updates
73
73
  end
74
74
 
75
75
  it "doesn't call I18n.relaod! when the synchronization file's updated_at is the same" do
76
- I18n.should_not_receive(:reload!)
76
+ expect(I18n).not_to receive(:reload!)
77
77
  @controller.handle_translation_updates
78
78
  end
79
79
  end
@@ -85,12 +85,12 @@ describe Localeapp::Rails::Controller, '#handle_translation_updates' do
85
85
 
86
86
  it "doesn't call I18n.reload! when the synchronization file's updated_at has changed" do
87
87
  Localeapp.poller.write_synchronization_data!(01234, 56789)
88
- I18n.should_not_receive(:reload!)
88
+ expect(I18n).not_to receive(:reload!)
89
89
  @controller.handle_translation_updates
90
90
  end
91
91
 
92
92
  it "doesn't call I18n.relaod! when the synchronization file's updated_at is the same" do
93
- I18n.should_not_receive(:reload!)
93
+ expect(I18n).not_to receive(:reload!)
94
94
  @controller.handle_translation_updates
95
95
  end
96
96
  end
@@ -127,19 +127,19 @@ describe Localeapp::Rails::Controller, '#send_missing_translations' do
127
127
 
128
128
  it "does nothing when sending is disabled" do
129
129
  Localeapp.configuration.environment_name = 'test'
130
- Localeapp.sender.should_not_receive(:post_missing_translations)
130
+ expect(Localeapp.sender).not_to receive(:post_missing_translations)
131
131
  @controller.send_missing_translations
132
132
  end
133
133
 
134
134
  it "proceeds when configuration is enabled" do
135
135
  Localeapp.configuration.environment_name = 'development'
136
- Localeapp.sender.should_receive(:post_missing_translations)
136
+ expect(Localeapp.sender).to receive(:post_missing_translations)
137
137
  @controller.send_missing_translations
138
138
  end
139
139
 
140
140
  it "rejects blacklisted translations" do
141
141
  Localeapp.configuration.environment_name = 'development'
142
- Localeapp.missing_translations.should_receive(:reject_blacklisted)
142
+ expect(Localeapp.missing_translations).to receive(:reject_blacklisted)
143
143
  @controller.send_missing_translations
144
144
  end
145
145
  end
@@ -14,8 +14,8 @@ describe Localeapp::Routes do
14
14
  it "returns :get and the project url for the options" do
15
15
  with_configuration(@config) do
16
16
  options = { :foo => :bar }
17
- @routes.should_receive(:project_url).with(options).and_return('url')
18
- @routes.project_endpoint(options).should == [:get, 'url']
17
+ expect(@routes).to receive(:project_url).with(options).and_return('url')
18
+ expect(@routes.project_endpoint(options)).to eq([:get, 'url'])
19
19
  end
20
20
  end
21
21
  end
@@ -23,19 +23,19 @@ describe Localeapp::Routes do
23
23
  describe '#project_url' do
24
24
  it "is constructed from the configuration host, port and secure and defaults to json" do
25
25
  with_configuration(@config.merge(:port => 1234, :secure => false)) do
26
- @routes.project_url.should == "http://test.host:1234/v1/projects/API_KEY.json"
26
+ expect(@routes.project_url).to eq("http://test.host:1234/v1/projects/API_KEY.json")
27
27
  end
28
28
  end
29
29
 
30
30
  it "includes http auth if in configuration" do
31
31
  with_configuration(@config.merge(:port => 1234, :http_auth_username => 'foo', :http_auth_password => 'bar')) do
32
- @routes.project_url.should == "https://foo:bar@test.host:1234/v1/projects/API_KEY.json"
32
+ expect(@routes.project_url).to eq("https://foo:bar@test.host:1234/v1/projects/API_KEY.json")
33
33
  end
34
34
  end
35
35
 
36
36
  it "can be changed to another content type" do
37
37
  with_configuration(@config) do
38
- @routes.project_url(:format => :yml).should == 'https://test.host/v1/projects/API_KEY.yml'
38
+ expect(@routes.project_url(:format => :yml)).to eq('https://test.host/v1/projects/API_KEY.yml')
39
39
  end
40
40
  end
41
41
  end
@@ -43,21 +43,21 @@ describe Localeapp::Routes do
43
43
  describe "#translations_url" do
44
44
  it "it extends the project_url and defaults to yml" do
45
45
  with_configuration(@config) do
46
- @routes.translations_url.should == "https://test.host/v1/projects/API_KEY/translations.yml"
46
+ expect(@routes.translations_url).to eq("https://test.host/v1/projects/API_KEY/translations.yml")
47
47
  end
48
48
  end
49
49
 
50
50
  it "adds query parameters on to the url" do
51
51
  with_configuration(@config) do
52
52
  url = @routes.translations_url(:query => {:updated_at => '2011-04-19', :foo => :bar})
53
- url.should match(/\?.*updated_at=2011-04-19/)
54
- url.should match(/\?.*foo=bar/)
53
+ expect(url).to match(/\?.*updated_at=2011-04-19/)
54
+ expect(url).to match(/\?.*foo=bar/)
55
55
  end
56
56
  end
57
57
 
58
58
  it "can be changed to another content type" do
59
59
  with_configuration(@config) do
60
- @routes.translations_url(:format => :json).should == 'https://test.host/v1/projects/API_KEY/translations.json'
60
+ expect(@routes.translations_url(:format => :json)).to eq('https://test.host/v1/projects/API_KEY/translations.json')
61
61
  end
62
62
  end
63
63
  end
@@ -66,8 +66,8 @@ describe Localeapp::Routes do
66
66
  it "returns :get and the translations url for the options" do
67
67
  with_configuration(@config) do
68
68
  options = { :foo => :bar }
69
- @routes.should_receive(:translations_url).with(options).and_return('url')
70
- @routes.translations_endpoint(options).should == [:get, 'url']
69
+ expect(@routes).to receive(:translations_url).with(options).and_return('url')
70
+ expect(@routes.translations_endpoint(options)).to eq([:get, 'url'])
71
71
  end
72
72
  end
73
73
  end
@@ -76,8 +76,8 @@ describe Localeapp::Routes do
76
76
  it "returns :post and the translation url for the options" do
77
77
  with_configuration(@config) do
78
78
  options = { :foo => :bar }
79
- @routes.should_receive(:translations_url).with(options).and_return('url')
80
- @routes.create_translation_endpoint(options).should == [:post, 'url']
79
+ expect(@routes).to receive(:translations_url).with(options).and_return('url')
80
+ expect(@routes.create_translation_endpoint(options)).to eq([:post, 'url'])
81
81
  end
82
82
  end
83
83
  end
@@ -86,8 +86,8 @@ describe Localeapp::Routes do
86
86
  it "returns :delete and the remove url for the options" do
87
87
  with_configuration(@config) do
88
88
  options = { :key => 'foo.bar' }
89
- @routes.should_receive(:remove_url).with(options).and_return('url')
90
- @routes.remove_endpoint(options).should == [:delete, 'url']
89
+ expect(@routes).to receive(:remove_url).with(options).and_return('url')
90
+ expect(@routes.remove_endpoint(options)).to eq([:delete, 'url'])
91
91
  end
92
92
  end
93
93
  end
@@ -95,7 +95,7 @@ describe Localeapp::Routes do
95
95
  describe "#remove_url(options = {})" do
96
96
  it "it extends the project_url and includes the escaped key name" do
97
97
  with_configuration(@config) do
98
- @routes.remove_url(:key => 'test.key').should == "https://test.host/v1/projects/API_KEY/translations/test%2Ekey"
98
+ expect(@routes.remove_url(:key => 'test.key')).to eq("https://test.host/v1/projects/API_KEY/translations/test%2Ekey")
99
99
  end
100
100
  end
101
101
  end
@@ -104,8 +104,8 @@ describe Localeapp::Routes do
104
104
  it "returns :post and the rename url for the options" do
105
105
  with_configuration(@config) do
106
106
  options = { :current_name => 'foo.bar' }
107
- @routes.should_receive(:rename_url).with(options).and_return('url')
108
- @routes.rename_endpoint(options).should == [:post, 'url']
107
+ expect(@routes).to receive(:rename_url).with(options).and_return('url')
108
+ expect(@routes.rename_endpoint(options)).to eq([:post, 'url'])
109
109
  end
110
110
  end
111
111
  end
@@ -113,7 +113,7 @@ describe Localeapp::Routes do
113
113
  describe "#rename_url(options = {})" do
114
114
  it "it extends the project_url and includes the escaped key name" do
115
115
  with_configuration(@config) do
116
- @routes.rename_url(:current_name => 'test.key').should == "https://test.host/v1/projects/API_KEY/translations/test%2Ekey/rename"
116
+ expect(@routes.rename_url(:current_name => 'test.key')).to eq("https://test.host/v1/projects/API_KEY/translations/test%2Ekey/rename")
117
117
  end
118
118
  end
119
119
  end
@@ -121,21 +121,21 @@ describe Localeapp::Routes do
121
121
  describe "#export_url" do
122
122
  it "it extends the project_url and defaults to yml" do
123
123
  with_configuration(@config) do
124
- @routes.export_url.should == "https://test.host/v1/projects/API_KEY/translations/all.yml"
124
+ expect(@routes.export_url).to eq("https://test.host/v1/projects/API_KEY/translations/all.yml")
125
125
  end
126
126
  end
127
127
 
128
128
  it "adds query parameters on to the url" do
129
129
  with_configuration(@config) do
130
130
  url = @routes.export_url(:query => {:updated_at => '2011-04-19', :foo => :bar})
131
- url.should match(/\?.*updated_at=2011-04-19/)
132
- url.should match(/\?.*foo=bar/)
131
+ expect(url).to match(/\?.*updated_at=2011-04-19/)
132
+ expect(url).to match(/\?.*foo=bar/)
133
133
  end
134
134
  end
135
135
 
136
136
  it "can be changed to another content type" do
137
137
  with_configuration(@config) do
138
- @routes.export_url(:format => :json).should == 'https://test.host/v1/projects/API_KEY/translations/all.json'
138
+ expect(@routes.export_url(:format => :json)).to eq('https://test.host/v1/projects/API_KEY/translations/all.json')
139
139
  end
140
140
  end
141
141
  end
@@ -144,8 +144,8 @@ describe Localeapp::Routes do
144
144
  it "returns :get and the export url for the options" do
145
145
  with_configuration(@config) do
146
146
  options = { :foo => :bar }
147
- @routes.should_receive(:export_url).with(options).and_return('url')
148
- @routes.export_endpoint(options).should == [:get, 'url']
147
+ expect(@routes).to receive(:export_url).with(options).and_return('url')
148
+ expect(@routes.export_endpoint(options)).to eq([:get, 'url'])
149
149
  end
150
150
  end
151
151
  end
@@ -154,8 +154,8 @@ describe Localeapp::Routes do
154
154
  it "returns :post and the missing_translations url for the options" do
155
155
  with_configuration(@config) do
156
156
  options = { :foo => :bar }
157
- @routes.should_receive(:missing_translations_url).with(options).and_return('url')
158
- @routes.missing_translations_endpoint(options).should == [:post, 'url']
157
+ expect(@routes).to receive(:missing_translations_url).with(options).and_return('url')
158
+ expect(@routes.missing_translations_endpoint(options)).to eq([:post, 'url'])
159
159
  end
160
160
  end
161
161
  end
@@ -163,21 +163,21 @@ describe Localeapp::Routes do
163
163
  describe "#missing_translations_url" do
164
164
  it "it extends the project_url and defaults to json" do
165
165
  with_configuration(@config) do
166
- @routes.missing_translations_url.should == "https://test.host/v1/projects/API_KEY/translations/missing.json"
166
+ expect(@routes.missing_translations_url).to eq("https://test.host/v1/projects/API_KEY/translations/missing.json")
167
167
  end
168
168
  end
169
169
 
170
170
  it "adds query parameters on to the url" do
171
171
  with_configuration(@config) do
172
172
  url = @routes.missing_translations_url(:query => {:updated_at => '2011-04-19', :foo => :bar})
173
- url.should match(/\?.*updated_at=2011-04-19/)
174
- url.should match(/\?.*foo=bar/)
173
+ expect(url).to match(/\?.*updated_at=2011-04-19/)
174
+ expect(url).to match(/\?.*foo=bar/)
175
175
  end
176
176
  end
177
177
 
178
178
  it "can be changed to another content type" do
179
179
  with_configuration(@config) do
180
- @routes.missing_translations_url(:format => :yml).should == 'https://test.host/v1/projects/API_KEY/translations/missing.yml'
180
+ expect(@routes.missing_translations_url(:format => :yml)).to eq('https://test.host/v1/projects/API_KEY/translations/missing.yml')
181
181
  end
182
182
  end
183
183
  end
@@ -185,7 +185,7 @@ describe Localeapp::Routes do
185
185
  describe "#import_url" do
186
186
  it "appends 'import to the project url" do
187
187
  with_configuration(@config) do
188
- @routes.import_url.should == 'https://test.host/v1/projects/API_KEY/import/'
188
+ expect(@routes.import_url).to eq('https://test.host/v1/projects/API_KEY/import/')
189
189
  end
190
190
  end
191
191
  end
@@ -194,8 +194,8 @@ describe Localeapp::Routes do
194
194
  it "returns :post and the import url for the options" do
195
195
  with_configuration(@config) do
196
196
  options = { :foo => :bar }
197
- @routes.should_receive(:import_url).with(options).and_return('url')
198
- @routes.import_endpoint(options).should == [:post, 'url']
197
+ expect(@routes).to receive(:import_url).with(options).and_return('url')
198
+ expect(@routes.import_endpoint(options)).to eq([:post, 'url'])
199
199
  end
200
200
  end
201
201
  end