Commit 939065e5 by ivan Lan

Fix spec

parent 25180735
......@@ -33,15 +33,15 @@ RSpec.describe WeatherModel do
end
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
it 'Forecast' do
@expire = 1
mysql = Forecast::CityForecast
ohm = ohm
mysql = ::WeatherModel::Forecast::CityForecast
ohm = ::WeatherModel::Forecast::CityForecast::Ohm
ohm.expire @expire
mysql_obj = mysql.create({
datetime: '2017-05-16',
......@@ -66,7 +66,7 @@ RSpec.describe WeatherModel do
end
it 'aqi_forecast' do
@aqi_forecast = Aqi::AqiForecast.create(
@aqi_forecast = ::WeatherModel::Aqi::AqiForecast.create(
datetime: Time.now,
prompt: '',
list: [
......@@ -83,8 +83,8 @@ RSpec.describe WeatherModel do
},
]
)
expect(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.all.first.list.class).to eq(Array), 'Mysql json_column 正常'
expect(::WeatherModel::Aqi::AqiForecast::Ohm.all.first.list.class).to eq(Array), 'Ohm json_column 正常'
end
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