Commit 939065e5 by ivan Lan

Fix spec

parent 25180735
...@@ -33,15 +33,15 @@ RSpec.describe WeatherModel do ...@@ -33,15 +33,15 @@ RSpec.describe WeatherModel do
end end
it 'Test factory_girl' do it 'Test factory_girl' do
expect(@obj.class).to eq(Forecast::CityForecast), 'factory_girl 生成成功' expect(@obj.class).to eq(::WeatherModel::Forecast::CityForecast), 'factory_girl 生成成功'
end end
end end
it 'Forecast' do it 'Forecast' do
@expire = 1 @expire = 1
mysql = Forecast::CityForecast mysql = ::WeatherModel::Forecast::CityForecast
ohm = ohm ohm = ::WeatherModel::Forecast::CityForecast::Ohm
ohm.expire @expire ohm.expire @expire
mysql_obj = mysql.create({ mysql_obj = mysql.create({
datetime: '2017-05-16', datetime: '2017-05-16',
...@@ -66,7 +66,7 @@ RSpec.describe WeatherModel do ...@@ -66,7 +66,7 @@ RSpec.describe WeatherModel do
end end
it 'aqi_forecast' do it 'aqi_forecast' do
@aqi_forecast = Aqi::AqiForecast.create( @aqi_forecast = ::WeatherModel::Aqi::AqiForecast.create(
datetime: Time.now, datetime: Time.now,
prompt: '', prompt: '',
list: [ list: [
...@@ -83,8 +83,8 @@ RSpec.describe WeatherModel do ...@@ -83,8 +83,8 @@ RSpec.describe WeatherModel do
}, },
] ]
) )
expect(Aqi::AqiForecast.all.first.list.class).to eq(Array), 'Mysql json_column 正常' expect(::WeatherModel::Aqi::AqiForecast.all.first.list.class).to eq(Array), 'Mysql json_column 正常'
expect(Aqi::AqiForecast::Ohm.all.first.list.class).to eq(Array), 'Ohm json_column 正常' expect(::WeatherModel::Aqi::AqiForecast::Ohm.all.first.list.class).to eq(Array), 'Ohm json_column 正常'
end end
describe 'test Ohm # to_h' do describe 'test Ohm # to_h' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment