Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weather-model
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
weather-model
Commits
f97227b0
Commit
f97227b0
authored
May 20, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for Aqi::Forecast
parent
b1e5b04d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
weather-model_spec.rb
spec/weather-model_spec.rb
+21
-0
No files found.
spec/weather-model_spec.rb
View file @
f97227b0
...
@@ -61,6 +61,27 @@ RSpec.describe WeatherModel do
...
@@ -61,6 +61,27 @@ RSpec.describe WeatherModel do
expect
(
Forecast
::
CityForecast
::
Ohm
.
all
.
count
).
to
eq
(
0
),
'TTL过期对象删除成功'
expect
(
Forecast
::
CityForecast
::
Ohm
.
all
.
count
).
to
eq
(
0
),
'TTL过期对象删除成功'
end
end
it
'aqi_forecast'
do
@aqi_forecast
=
Aqi
::
Forecast
.
create
(
datetime:
Time
.
now
,
prompt:
''
,
list:
[
{
"period"
=>
"今天夜间(20时—06时)"
,
"aqi"
=>
"35-55"
,
"level"
=>
"优到良"
,
"pripoll"
=>
"PM10"
},
{
"period"
=>
"明天上午(06时—12时)"
,
"aqi"
=>
"35-55"
,
"level"
=>
"优到良"
,
"pripoll"
=>
"PM10"
},
]
)
expect
(
Aqi
::
Forecast
::
Ohm
.
all
.
first
).
not_to
be_nil
,
'json_column 正常'
end
after
do
after
do
ActiveRecord
::
Migration
[
5.0
].
subclasses
.
each
do
|
migrate
|
ActiveRecord
::
Migration
[
5.0
].
subclasses
.
each
do
|
migrate
|
migrate
.
migrate
(
:down
)
migrate
.
migrate
(
:down
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment