Commit 7b33aff4 authored by Shinya Maeda's avatar Shinya Maeda

Fix test to use bang method for making sure its updated

parent 19bc4afb
...@@ -759,7 +759,7 @@ describe Project do ...@@ -759,7 +759,7 @@ describe Project do
context 'when environment scope is exactly matched' do context 'when environment scope is exactly matched' do
before do before do
cluster.update(environment_scope: 'review/name') cluster.update!(environment_scope: 'review/name')
end end
it_behaves_like 'matching environment scope' it_behaves_like 'matching environment scope'
...@@ -767,7 +767,7 @@ describe Project do ...@@ -767,7 +767,7 @@ describe Project do
context 'when environment scope is matched by wildcard' do context 'when environment scope is matched by wildcard' do
before do before do
cluster.update(environment_scope: 'review/*') cluster.update!(environment_scope: 'review/*')
end end
it_behaves_like 'matching environment scope' it_behaves_like 'matching environment scope'
...@@ -775,7 +775,7 @@ describe Project do ...@@ -775,7 +775,7 @@ describe Project do
context 'when environment scope does not match' do context 'when environment scope does not match' do
before do before do
cluster.update(environment_scope: 'review/*/special') cluster.update!(environment_scope: 'review/*/special')
end end
it_behaves_like 'not matching environment scope' it_behaves_like 'not matching environment scope'
...@@ -789,14 +789,14 @@ describe Project do ...@@ -789,14 +789,14 @@ describe Project do
end end
it 'does not treat it as wildcard' do it 'does not treat it as wildcard' do
cluster.update(environment_scope: 'foo_bar/*') cluster.update!(environment_scope: 'foo_bar/*')
is_expected.to eq(default_cluster.platform_kubernetes) is_expected.to eq(default_cluster.platform_kubernetes)
end end
it 'matches literally for _' do it 'matches literally for _' do
cluster.update(environment_scope: 'foo_bar/*') cluster.update!(environment_scope: 'foo_bar/*')
environment.update(name: 'foo_bar/test') environment.update!(name: 'foo_bar/test')
is_expected.to eq(cluster.platform_kubernetes) is_expected.to eq(cluster.platform_kubernetes)
end end
...@@ -819,8 +819,8 @@ describe Project do ...@@ -819,8 +819,8 @@ describe Project do
is_expected.to eq(default_cluster.platform_kubernetes) is_expected.to eq(default_cluster.platform_kubernetes)
end end
it 'matches literally for _' do it 'matches literally for %' do
cluster.update(environment_scope: 'foo%bar/*') cluster.update_attribute(:environment_scope, 'foo%bar/*')
environment.update_attribute(:name, 'foo%bar/test') environment.update_attribute(:name, 'foo%bar/test')
is_expected.to eq(cluster.platform_kubernetes) is_expected.to eq(cluster.platform_kubernetes)
......
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