-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathurn_date_dim_spec.rb
53 lines (42 loc) · 1.59 KB
/
urn_date_dim_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
require 'gooddata'
describe "Blueprint now support urn in date dimension", :vcr, :constraint => 'slow' do
before(:all) do
@client = ConnectionHelper.create_default_connection
@blueprint = GoodData::Model::ProjectBlueprint.build("My project from blueprint") do |p|
p.add_date_dimension('created_on', urn: 'urn:pe:date')
end
end
after(:all) do
@client && @client.disconnect
end
context 'project creates from blueprint contains urn in date dimension' do
before(:all) do
@project = @client.create_project_from_blueprint(@blueprint, token: ConnectionHelper::SECRETS[:gd_project_token], environment: ProjectHelper::ENVIRONMENT)
end
after(:all) do
@project && @project.delete
end
it 'should have urn in date dimension' do
expect(@project.datasets.find(&:date_dimension?).content['urn']).to eq 'urn:pe:date'
end
it 'blueprint contains urn in date dimension' do
expect(@project.blueprint.date_dimensions.first.urn).to eq 'urn:pe:date'
end
end
context 'merging blueprint' do
before do
@new_bp = GoodData::Model::ProjectBlueprint.build("update") do |p|
p.add_date_dimension('created_on', urn: 'urn:stonegate:date')
end
@blueprint = @blueprint.merge(@new_bp)
end
it 'update urn' do
expect(@blueprint.date_dimensions.first.urn).to eq 'urn:stonegate:date'
end
end
end