README.md in trice-0.2.0 vs README.md in trice-0.2.1
- old
+ new
@@ -37,11 +37,11 @@
- `requested_at`: returns timestamp of action invoked (or stubbed timestamp, see below).
### Include helper module outside of controller
-Inlude `Trice::ReferenceTime` add `#reference_time` method to lookup current reference time.
+Include `Trice::ReferenceTime` add `#reference_time` method to lookup current reference time.
Use it in Rails model.
```ruby
class MyWork
@@ -82,29 +82,29 @@
Trice allows you to stub reference time to run travelled time-testing and / or previewing your app in future time.
Set `_requested_at=<timish>` query parameter like below
```
-$ curl https://example.com/campaigns/12345?_requested_at=20160215130
+$ curl https://example.com/campaigns/12345?_requested_at=201602151300
```
Or can set HTTP header, useful for tests.
```
X-REQUESTED-AT: 2016-02-15T13:00:00+09:00
```
-Value format, which specified both query parameter and header, should be `Time.parsse` parasable.
+Value format, which specified both query parameter and header, should be `Time.parse` parasable.
#### Enable/Disable stubbing
-Toggle requested at stubbing in `config/initializers`. The default is below, enabled unelss `Rails.env.production?`.
+Toggle requested at stubbing in `config/initializers`. The default is below, enabled unless `Rails.env.production?`.
```ruby
Trice.support_requested_at_stubbing = !Rails.env.production?
```
-Setting callable object let you choice enable/disable dinamically by seeing request.
+Setting callable object let you choice enable/disable dynamically by seeing request.
```ruby
our_office_network = IPAddr.new('203.0.113.0/24')
Trice.support_requested_at_stubbing = ->(controller) {
@@ -125,11 +125,11 @@
```
I recommend to pass reference time to a model by method and/or constructor argument because reference time is an external input, should be handled controller layer.
But sometimes it is required from deep inside of model logics and tests for them.
-Model unit spec has `with_reference_time` and `set_now_to_reference_time` declarition method to set `Trice.reference_time` in an example.
+Model unit spec has `with_reference_time` and `set_now_to_reference_time` declaration method to set `Trice.reference_time` in an example.
```ruby
describe MyModel do
let(:reference_time) { Time.zone.parse('2016/02/03 12:00') }
context do
@@ -143,10 +143,10 @@
end
end
end
```
-Feature specs (or othre Capybara based E2E tests) also has helper method using stubbing mechanism. `stub_requested_at <timish>` set `X-Trice-Requested-At` automatically.
+Feature specs (or other Capybara based E2E tests) also has helper method using stubbing mechanism. `stub_requested_at <timish>` set `X-Trice-Requested-At` automatically.
```ruby
context 'on ひな祭り day' do
stub_requested_at Time.zone.parse('2016-03-03 10:00')