openehr-rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92a4348de69e23c4a2ad1a7e94474c64cf0edbe1
4
- data.tar.gz: d046a39a04e8a17b6ffe8f1442316aaf42decda4
3
+ metadata.gz: edebd8ffbc62aa73c4a68c3228cd620785d9d5da
4
+ data.tar.gz: 8adab5b662a5e326cfa8f789b94edad7f01a47a2
5
5
  SHA512:
6
- metadata.gz: f113378a660a76c57260ed2f32ca06f62ae86a2160366142324c4284b51f1db9c385469551f67639fed23e9c43abe335f409587ef3c566ee9e3bf3ac53b0d6b3
7
- data.tar.gz: 733160daa158dcb5c9f5acdf9c751b23854a17d78562312b6d8475bc85bbf21fd9ceb34359d062d9348f9b43146cbafd059c3b0b5cf1e03d30b6e8e9fb701873
6
+ metadata.gz: 14bc325f51ef06ace5fbcea0d809d1eb584f98107382552709b2b16bb16078e7768d7ec5dc76a8d55a625a0157dd1df026dbeb6b49ede8993c22ebc0adacf23c
7
+ data.tar.gz: bba6b194d42a8ab8223141a210a55f1eb3a366fa85289f84f415dfeafb3585ff33868ed5fda7defa60142dd590a65faddbcbd7e7aa05409ab2117de3f90891ba
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
-
2
+ gem 'openehr', path: '~/src/openehr-ruby'
3
3
  gemspec
@@ -17,7 +17,7 @@ module Openehr
17
17
 
18
18
  protected
19
19
  def archetype
20
- @archetype ||= OpenEHR::Parser::ADLParser.new(@adl_file).parse
20
+ @archetype ||= ::OpenEHR::Parser::ADLParser.new(archetype_file).parse
21
21
  end
22
22
 
23
23
  def archetype_path
@@ -1,5 +1,5 @@
1
1
  module OpenEHR
2
2
  module Rails
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
21
 
22
22
  gem.require_paths = ["lib"]
23
- gem.add_dependency('openehr')
23
+ # gem.add_dependency('openehr')
24
24
  gem.add_dependency('rails', '~> 4.1.0')
25
25
  gem.add_dependency('ckm_client')
26
26
 
@@ -1,3 +1,4 @@
1
1
  def archetype
2
- @archetype ||= OpenEHR::Parser::ADLParser.new('spec/generators/templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl').parse
2
+ @archetype ||= OpenEHR::Parser::ADLParser.new(File.join(File.dirname(__FILE__), 'generators/templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl')).parse
3
3
  end
4
+ # let(:archetype) {OpenEHR::Parser::ADLParser.new('spec/generators/templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl').parse}
@@ -5,33 +5,34 @@ require 'generator_helper'
5
5
  module Openehr
6
6
  module Generators
7
7
  describe ArchetypedBase do
8
- before (:each) do
9
- @archetyped_base = Openehr::Generators::ArchetypedBase.new([archetype])
10
- end
8
+ let(:adl_file) { File.expand_path('../../templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl', __FILE__) }
11
9
 
12
10
  context 'archetype file' do
13
11
  it 'archetype file is adl_file' do
14
- adl_file = File.expand_path '../../templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl', __FILE__
15
12
  archetyped_base = Openehr::Generators::ArchetypedBase.new([adl_file])
16
- archetyped_base.send(:archetype_file).should == File.expand_path('../../templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl', __FILE__)
13
+ expect(archetyped_base.send(:archetype_file)).to eq(File.expand_path('../../templates/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl', __FILE__))
17
14
  end
18
15
  end
19
16
 
20
- context 'archetype path' do
21
- it 'archetype_path is app/archetypes' do
22
- @archetyped_base.send(:archetype_path).should == 'app/archetypes'
17
+ describe 'protected values' do
18
+ let(:archetyped_base) {Openehr::Generators::ArchetypedBase.new([archetype])}
19
+
20
+ context 'archetype path' do
21
+ it 'archetype_path is app/archetypes' do
22
+ expect(archetyped_base.send(:archetype_path)).to eq('app/archetypes')
23
+ end
23
24
  end
24
- end
25
25
 
26
- context 'model name' do
27
- it 'is origined form archetype id' do
28
- expect(@archetyped_base.send(:model_name)).to eq 'open_ehr_ehr_observation_blood_pressure_v1'
26
+ context 'model name' do
27
+ it 'is origined form archetype id' do
28
+ expect(archetyped_base.send(:model_name)).to eq 'open_ehr_ehr_observation_blood_pressure_v1'
29
+ end
29
30
  end
30
- end
31
31
 
32
- context 'controller_name' do
33
- it 'is originated from archtype id' do
34
- expect(@archetyped_base.send(:controller_name)).to eq 'open_ehr_ehr_observation_blood_pressure_v1'
32
+ context 'controller_name' do
33
+ it 'is originated from archtype id' do
34
+ expect(archetyped_base.send(:controller_name)).to eq 'open_ehr_ehr_observation_blood_pressure_v1'
35
+ end
35
36
  end
36
37
  end
37
38
  end
@@ -17,20 +17,20 @@ module Openehr
17
17
  context 'scaffold.css' do
18
18
  subject { file('app/assets/stylesheets/scaffold.css') }
19
19
 
20
- it { should exist }
21
- it { should contain /body {/}
20
+ it { is_expected.to exist }
21
+ it { is_expected.to contain /body {/}
22
22
  end
23
23
 
24
24
  context 'generate scss file' do
25
25
  subject { file('app/assets/stylesheets/open_ehr_ehr_observation_blood_pressure_v1.css.scss') }
26
26
 
27
- it { should exist }
27
+ it { is_expected.to exist }
28
28
  end
29
29
 
30
30
  context 'generate coffeescript' do
31
31
  subject { file('app/assets/javascripts/open_ehr_ehr_observation_blood_pressure_v1.js.coffee') }
32
32
 
33
- it { should exist }
33
+ it { is_expected.to exist }
34
34
  end
35
35
  end
36
36
  end
@@ -16,9 +16,9 @@ module Openehr
16
16
 
17
17
  subject { file('app/controllers/open_ehr_ehr_observation_blood_pressure_v1_controller.rb') }
18
18
 
19
- it { should exist }
19
+ it { is_expected.to exist }
20
20
 
21
- it { should contain /^class OpenEhrEhrObservationBloodPressureV1Controller < ApplicationController$/ }
21
+ it { is_expected.to contain /^class OpenEhrEhrObservationBloodPressureV1Controller < ApplicationController$/ }
22
22
  end
23
23
  end
24
24
  end
@@ -15,8 +15,8 @@ module Openehr
15
15
  context 'helper generation' do
16
16
  subject { file('app/helpers/open_ehr_ehr_observation_blood_pressure_v1_helper.rb') }
17
17
 
18
- it { should exist }
19
- it { should contain /module OpenEhrEhrObservationBloodPressureV1Helper/ }
18
+ it { is_expected.to exist }
19
+ it { is_expected.to contain /module OpenEhrEhrObservationBloodPressureV1Helper/ }
20
20
  end
21
21
  end
22
22
  end
@@ -17,43 +17,43 @@ module Openehr
17
17
  describe 'i18n.rb generation' do
18
18
  subject { file('config/initializers/i18n.rb') }
19
19
 
20
- it { should exist }
21
- it { should contain /I18n\.default_locale = :en/ }
22
- it { should contain /LANGUAGES/ }
23
- it { should contain /\['English', 'en'\],/ }
24
- it { should contain /\['Japanese', 'ja'\]/ }
25
- it { should contain /\['Dutch', 'nl'\],/ }
20
+ it { is_expected.to exist }
21
+ it { is_expected.to contain /I18n\.default_locale = :en/ }
22
+ it { is_expected.to contain /LANGUAGES/ }
23
+ it { is_expected.to contain /\['English', 'en'\],/ }
24
+ it { is_expected.to contain /\['Japanese', 'ja'\]/ }
25
+ it { is_expected.to contain /\['Dutch', 'nl'\],/ }
26
26
  end
27
27
 
28
28
  describe 'en.yml generation' do
29
29
  subject { file('config/locales/en.yml') }
30
30
 
31
- it { should exist }
32
- it { should contain /en:/ }
33
- it { should contain /layouts:/ }
34
- it { should contain /application:/ }
35
- it { should contain /open_ehr_ehr_observation_blood_pressure_v1/ }
36
- it { should contain /index: &ontology/ }
37
- it { should contain /at0000: "Blood Pressure"/ }
38
- it { should contain /at0001: "history"/ }
39
- it { should contain /new: \*ontology/ }
40
- it { should contain /form: \*ontology/ }
41
- it { should contain /show: \*ontology/ }
42
- it { should contain /edit: \*ontology/ }
31
+ it { is_expected.to exist }
32
+ it { is_expected.to contain /en:/ }
33
+ it { is_expected.to contain /layouts:/ }
34
+ it { is_expected.to contain /application:/ }
35
+ it { is_expected.to contain /open_ehr_ehr_observation_blood_pressure_v1/ }
36
+ it { is_expected.to contain /index: &ontology/ }
37
+ it { is_expected.to contain /at0000: "Blood Pressure"/ }
38
+ it { is_expected.to contain /at0001: "history"/ }
39
+ it { is_expected.to contain /new: \*ontology/ }
40
+ it { is_expected.to contain /form: \*ontology/ }
41
+ it { is_expected.to contain /show: \*ontology/ }
42
+ it { is_expected.to contain /edit: \*ontology/ }
43
43
  end
44
44
 
45
45
  describe 'ja.yml generation' do
46
46
  subject { file('config/locales/ja.yml')}
47
47
 
48
- it { should exist }
49
- it { should contain /ja:/ }
48
+ it { is_expected.to exist }
49
+ it { is_expected.to contain /ja:/ }
50
50
  end
51
51
 
52
52
  describe 'nl.yml generation' do
53
53
  subject { file('config/locales/nl.yml') }
54
54
 
55
- it { should exist }
56
- it { should contain /nl:/ }
55
+ it { is_expected.to exist }
56
+ it { is_expected.to contain /nl:/ }
57
57
  end
58
58
  end
59
59
  end
@@ -10,6 +10,6 @@ describe Openehr::Generators::InstallGenerator do
10
10
  end
11
11
 
12
12
  it 'makes app/archetypes directory' do
13
- file('app/archetypes').should exist
13
+ expect(file('app/archetypes')).to exist
14
14
  end
15
15
  end
@@ -14,13 +14,13 @@ module Openehr
14
14
  context 'default archetype db migration' do
15
15
  subject { file('db/migrate/create_archetypes.rb') }
16
16
 
17
- it { should be_a_migration }
17
+ it { is_expected.to be_a_migration }
18
18
  end
19
19
 
20
20
  context 'default rm db migration' do
21
21
  subject { file('db/migrate/create_rms.rb') }
22
22
 
23
- it { should be_a_migration }
23
+ it { is_expected.to be_a_migration }
24
24
  end
25
25
  end
26
26
  end
@@ -15,40 +15,40 @@ module Openehr
15
15
  context 'rm.rb generation' do
16
16
  subject { file('app/models/rm.rb') }
17
17
 
18
- it { should exist }
19
- it { should contain 'class Rm < ActiveRecord::Base' }
20
- it { should contain 'belongs_to :archetype' }
18
+ it { is_expected.to exist }
19
+ it { is_expected.to contain 'class Rm < ActiveRecord::Base' }
20
+ it { is_expected.to contain 'belongs_to :archetype' }
21
21
  end
22
22
 
23
23
  context 'archetype.rb generation' do
24
24
  subject { file('app/models/archetype.rb') }
25
25
 
26
- it { should exist }
27
- it { should contain 'class Archetype < ActiveRecord::Base' }
28
- it { should contain 'has_many :rms, dependent: :destroy' }
26
+ it { is_expected.to exist }
27
+ it { is_expected.to contain 'class Archetype < ActiveRecord::Base' }
28
+ it { is_expected.to contain 'has_many :rms, dependent: :destroy' }
29
29
  end
30
30
 
31
31
  context 'interim model generation' do
32
32
  subject { file('app/models/open_ehr_ehr_observation_blood_pressure_v1.rb') }
33
33
 
34
- it { should exist }
35
- it { should contain 'class OpenEhrEhrObservationBloodPressureV1' }
36
- it { should contain 'OpenEhrEhrObservationBloodPressureV1.new(archetype: archetype)' }
37
- it { should contain 'OpenEhrEhrObservationBloodPressureV1.new(archetype: Archetype.find(id))' }
38
- it { should contain "def self.build(params)\n OpenEhrEhrObservationBloodPressureV1.new(params)"}
39
- it { should contain 'archetype.rms.inject(archetype.save, :&) {|rm| rm.save' }
40
- it { should contain "def update(attributes)\n self.attributes=attributes" }
41
- it { should contain "@archetype ||= Archetype.new(archetypeid: 'openEHR-EHR-OBSERVATION.blood_pressure.v1', uid: SecureRandom.uuid)" }
42
- it { should contain /def at0004$/ }
43
- it { should contain /at0004model.num_value$/}
44
- it { should contain 'def at0004=(at0004)' }
45
- it { should contain 'at0004model.num_value = at0004'}
46
- it { should contain 'at0004model.save'}
47
- it { should contain 'translate(at0008model.text_value)'}
48
- it { should contain 'def confat(node_id, path)'}
49
- it { should contain 'archetype.rms.build(:node_id => node_id, :path => path)' }
50
- it { should contain 'I18n.translate("open_ehr_ehr_observation_blood_pressure_v1.index.#{term}")'}
51
- it { should contain "def persisted?\n archetype.persisted?"}
34
+ it { is_expected.to exist }
35
+ it { is_expected.to contain 'class OpenEhrEhrObservationBloodPressureV1' }
36
+ it { is_expected.to contain 'OpenEhrEhrObservationBloodPressureV1.new(archetype: archetype)' }
37
+ it { is_expected.to contain 'OpenEhrEhrObservationBloodPressureV1.new(archetype: Archetype.find(id))' }
38
+ it { is_expected.to contain "def self.build(params)\n OpenEhrEhrObservationBloodPressureV1.new(params)"}
39
+ it { is_expected.to contain 'archetype.rms.inject(archetype.save, :&) {|rm| rm.save' }
40
+ it { is_expected.to contain "def update(attributes)\n self.attributes=attributes" }
41
+ it { is_expected.to contain "@archetype ||= Archetype.new(archetypeid: 'openEHR-EHR-OBSERVATION.blood_pressure.v1', uid: SecureRandom.uuid)" }
42
+ it { is_expected.to contain /def at0004$/ }
43
+ it { is_expected.to contain /at0004model.num_value$/}
44
+ it { is_expected.to contain 'def at0004=(at0004)' }
45
+ it { is_expected.to contain 'at0004model.num_value = at0004'}
46
+ it { is_expected.to contain 'at0004model.save'}
47
+ it { is_expected.to contain 'translate(at0008model.text_value)'}
48
+ it { is_expected.to contain 'def confat(node_id, path)'}
49
+ it { is_expected.to contain 'archetype.rms.build(:node_id => node_id, :path => path)' }
50
+ it { is_expected.to contain 'I18n.translate("open_ehr_ehr_observation_blood_pressure_v1.index.#{term}")'}
51
+ it { is_expected.to contain "def persisted?\n archetype.persisted?"}
52
52
  end
53
53
  end
54
54
  end
@@ -16,13 +16,13 @@ module Openehr
16
16
  context 'generate rm migration' do
17
17
  subject { file('db/migrate/create_rms.rb') }
18
18
 
19
- it { should be_a_migration}
19
+ it { is_expected.to be_a_migration}
20
20
  end
21
21
 
22
22
  context 'generate archetype migration' do
23
23
  subject { file('db/migrate/create_archetypes.rb') }
24
24
 
25
- it { should be_a_migration }
25
+ it { is_expected.to be_a_migration }
26
26
  end
27
27
  end
28
28
 
@@ -30,113 +30,113 @@ module Openehr
30
30
  context 'generate rm model' do
31
31
  subject { file('app/models/open_ehr_ehr_observation_blood_pressure_v1.rb') }
32
32
 
33
- it { should exist}
33
+ it { is_expected.to exist}
34
34
  end
35
35
 
36
36
  context 'invoke index.html.erb template engine' do
37
37
  subject { file('app/views/open_ehr_ehr_observation_blood_pressure_v1/index.html.erb') }
38
38
 
39
- it { should exist }
40
- it { should contain '<h1>Listing <%= t(".at0000") %></h1>' }
41
- it { should contain '<th><%= t(".at0004") %></th>' }
42
- it { should contain '<th><%= t(".at0005") %></th>' }
43
- it { should_not contain '<th><%= t(".at0006") %></th>' }
44
- it { should contain '<td><%= open_ehr_ehr_observation_blood_pressure_v1.at0004 %></td>' }
45
- it { should contain "<%= link_to 'Show', open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id) %>"}
46
- it { should contain "<%= link_to 'Edit', edit_open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id) %>" }
47
- it { should contain "<%= link_to 'Destroy', open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id), method: :delete, data: { confirm: 'Are you sure?' } %>"}
39
+ it { is_expected.to exist }
40
+ it { is_expected.to contain '<h1>Listing <%= t(".at0000") %></h1>' }
41
+ it { is_expected.to contain '<th><%= t(".at0004") %></th>' }
42
+ it { is_expected.to contain '<th><%= t(".at0005") %></th>' }
43
+ it { is_expected.not_to contain '<th><%= t(".at0006") %></th>' }
44
+ it { is_expected.to contain '<td><%= open_ehr_ehr_observation_blood_pressure_v1.at0004 %></td>' }
45
+ it { is_expected.to contain "<%= link_to 'Show', open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id) %>"}
46
+ it { is_expected.to contain "<%= link_to 'Edit', edit_open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id) %>" }
47
+ it { is_expected.to contain "<%= link_to 'Destroy', open_ehr_ehr_observation_blood_pressure_v1_path(id: open_ehr_ehr_observation_blood_pressure_v1.id), method: :delete, data: { confirm: 'Are you sure?' } %>"}
48
48
  end
49
49
 
50
50
  context 'invoke show.html.erb template engine' do
51
51
  subject { file('app/views/open_ehr_ehr_observation_blood_pressure_v1/show.html.erb') }
52
52
 
53
- it { should contain 'Data' }
54
- it { should contain "<strong><%= t('.at0005') %></strong>: " }
55
- it { should contain '<%= @open_ehr_ehr_observation_blood_pressure_v1.at0005 %>mm[Hg]<br/>' }
56
- it { should contain 'Protocol' }
57
- it { should contain "<strong><%= t('.at0013') %></strong>: <%= @open_ehr_ehr_observation_blood_pressure_v1.at0013 %>"}
53
+ it { is_expected.to contain 'Data' }
54
+ it { is_expected.to contain "<strong><%= t('.at0005') %></strong>: " }
55
+ it { is_expected.to contain '<%= @open_ehr_ehr_observation_blood_pressure_v1.at0005 %>mm[Hg]<br/>' }
56
+ it { is_expected.to contain 'Protocol' }
57
+ it { is_expected.to contain "<strong><%= t('.at0013') %></strong>: <%= @open_ehr_ehr_observation_blood_pressure_v1.at0013 %>"}
58
58
  end
59
59
 
60
60
  context 'invoke edit.html.erb template engine' do
61
61
  subject { file('app/views/open_ehr_ehr_observation_blood_pressure_v1/edit.html.erb') }
62
62
 
63
- it { should exist }
64
- it { should contain "Editing <%= t('.at0000')"}
63
+ it { is_expected.to exist }
64
+ it { is_expected.to contain "Editing <%= t('.at0000')"}
65
65
  end
66
66
 
67
67
  context 'invoke new.html.erb template engine' do
68
68
  subject { file('app/views/open_ehr_ehr_observation_blood_pressure_v1/new.html.erb')}
69
69
 
70
- it { should exist}
71
- it { should contain /New \<%= t\(\".at0000\"\) %\>/ }
70
+ it { is_expected.to exist}
71
+ it { is_expected.to contain /New \<%= t\(\".at0000\"\) %\>/ }
72
72
  end
73
73
 
74
74
  context 'invoke _form.html.erb template engine' do
75
75
  subject { file('app/views/open_ehr_ehr_observation_blood_pressure_v1/_form.html.erb')}
76
76
 
77
- it { should exist }
78
- it { should contain "f.select :at0013, t('.at0015') => 'at0015', t('.at0016') => 'at0016'"}
79
- it { should contain "<%= t('.at0006') %></strong>: <%= f.text_field :at0006 %>" }
77
+ it { is_expected.to exist }
78
+ it { is_expected.to contain "f.select :at0013, t('.at0015') => 'at0015', t('.at0016') => 'at0016'"}
79
+ it { is_expected.to contain "<%= t('.at0006') %></strong>: <%= f.text_field :at0006 %>" }
80
80
  end
81
81
 
82
82
  context 'invoke routing generator' do
83
83
  subject { file('config/routes.rb')}
84
84
 
85
- it { should contain 'resources :open_ehr_ehr_observation_blood_pressure_v1'}
85
+ it { is_expected.to contain 'resources :open_ehr_ehr_observation_blood_pressure_v1'}
86
86
  end
87
87
 
88
88
  context 'Insert inflection setting' do
89
89
  subject { file('config/initializers/inflections.rb') }
90
90
 
91
- it { should contain 'inflect.uncountable %w( open_ehr_ehr_observation_blood_pressure_v1 )' }
91
+ it { is_expected.to contain 'inflect.uncountable %w( open_ehr_ehr_observation_blood_pressure_v1 )' }
92
92
  end
93
93
 
94
94
  context 'invoke assets generator' do
95
95
  subject { file('app/assets/stylesheets/scaffold.css') }
96
96
 
97
- it { should exist }
97
+ it { is_expected.to exist }
98
98
  end
99
99
 
100
100
  context 'i18n generator' do
101
101
  subject { file('config/initializers/i18n.rb') }
102
102
 
103
- it { should exist }
103
+ it { is_expected.to exist }
104
104
  end
105
105
 
106
106
  context 'add locale switcher to application.html.erb' do
107
107
  subject { file('app/views/layouts/application.html.erb') }
108
108
 
109
- it { should exist }
110
- it { should contain /\<%= select_tag 'locale',/ }
111
- it { should contain /options_for_select\(LANGUAGES, I18n\.locale.to_s\),/ }
109
+ it { is_expected.to exist }
110
+ it { is_expected.to contain /\<%= select_tag 'locale',/ }
111
+ it { is_expected.to contain /options_for_select\(LANGUAGES, I18n\.locale.to_s\),/ }
112
112
  end
113
113
 
114
114
  context 'layout.css.scss' do
115
115
  subject { file('app/assets/stylesheets/layout.css.scss') }
116
116
 
117
- it { should exist }
118
- it { should contain /\.locale {/ }
117
+ it { is_expected.to exist }
118
+ it { is_expected.to contain /\.locale {/ }
119
119
  end
120
120
 
121
121
  context 'invoke helper generator' do
122
122
  subject { file('app/helpers/open_ehr_ehr_observation_blood_pressure_v1_helper.rb')}
123
123
 
124
- it { should exist }
124
+ it { is_expected.to exist }
125
125
  end
126
126
 
127
127
  describe 'controller generator' do
128
128
  subject { file('app/controllers/open_ehr_ehr_observation_blood_pressure_v1_controller.rb') }
129
129
 
130
- it { should exist }
130
+ it { is_expected.to exist }
131
131
  end
132
132
 
133
133
  describe 'application controller modifier' do
134
134
  subject { file('app/controllers/application_controller.rb') }
135
135
 
136
- it { should contain /before_action :set_locale/ }
137
- it { should contain /def set_locale/ }
138
- it { should contain /I18n\.locale = params\[:locale\] \|\| session\[:locale\] \|\| I18n\.default_locale/ }
139
- it { should contain /end$/ }
136
+ it { is_expected.to contain /before_action :set_locale/ }
137
+ it { is_expected.to contain /def set_locale/ }
138
+ it { is_expected.to contain /I18n\.locale = params\[:locale\] \|\| session\[:locale\] \|\| I18n\.default_locale/ }
139
+ it { is_expected.to contain /end$/ }
140
140
  end
141
141
  end
142
142
  end