PERF: Speed up slow tests in our test suite.

Before

```
Finished in 7 minutes 23 seconds (files took 4.15 seconds to load)
7145 examples, 0 failures, 10 pending
```

After

```
Finished in 6 minutes 12 seconds (files took 4.41 seconds to load)
7145 examples, 0 failures, 10 pending
```
This commit is contained in:
Guo Xiang Tan
2017-06-22 11:23:31 +09:00
parent 8fd915a11a
commit 80e348d226
6 changed files with 63 additions and 67 deletions

View File

@ -48,12 +48,11 @@ describe Admin::SiteTextsController do
describe 'failure' do
before do
TranslationOverride.any_instance.expects(:lookup_original_text)
.returns('%{first} %{second}')
I18n.backend.store_translations(:en, some_key: '%{first} %{second}')
end
it 'returns the right error message' do
xhr :put, :update, id: 'title', site_text: { value: 'hello %{key}' }
xhr :put, :update, id: 'some_key', site_text: { value: 'hello %{key}' }
expect(response.status).to eq(422)