aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorteddywing2017-11-08 15:17:42 +0100
committerGitHub2017-11-08 15:17:42 +0100
commit4dbe0a7b5acf4e244016d58d59a96aca36035263 (patch)
treedc5e6224ebf14e87d8e3adeb22c1a0bb5d1ed246 /spec
parent0fc367c0095839f5089d5807767c1319e3d94ec0 (diff)
parent5fee40024adbdbcfc858170019b327a031b15848 (diff)
downloadchouette-core-4dbe0a7b5acf4e244016d58d59a96aca36035263.tar.bz2
Merge pull request #110 from af83/4755-page_for_validate_referential
4755 page for validate referential
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/referentials_controller_spec.rb8
-rw-r--r--spec/decorators/referential_decorator_spec.rb2
-rw-r--r--spec/helpers/table_builder_helper_spec.rb1
3 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/referentials_controller_spec.rb b/spec/controllers/referentials_controller_spec.rb
index a3be0dbd1..fba063085 100644
--- a/spec/controllers/referentials_controller_spec.rb
+++ b/spec/controllers/referentials_controller_spec.rb
@@ -22,4 +22,12 @@ describe ReferentialsController, :type => :controller do
end
end
+ describe 'GET select_compliance_control_set' do
+ it 'gets compliance control set for current organisation' do
+ compliance_control_set = create(:compliance_control_set, organisation: @user.organisation)
+ create(:compliance_control_set)
+ get :select_compliance_control_set, referential_id: referential.id
+ expect(assigns[:compliance_control_sets]).to eq([compliance_control_set])
+ end
+ end
end
diff --git a/spec/decorators/referential_decorator_spec.rb b/spec/decorators/referential_decorator_spec.rb
index 16da8d30b..3959a5924 100644
--- a/spec/decorators/referential_decorator_spec.rb
+++ b/spec/decorators/referential_decorator_spec.rb
@@ -34,6 +34,7 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do
expect_action_link_hrefs.to eq([
referential_time_tables_path(object),
new_referential_path(from: object),
+ referential_select_compliance_control_set_path(object)
])
end
end
@@ -46,6 +47,7 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do
expect_action_link_hrefs.to eq([
referential_time_tables_path(object),
new_referential_path(from: object),
+ referential_select_compliance_control_set_path(object),
archive_referential_path(object),
referential_path(object)
])
diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb
index 4d9808044..a8854bf97 100644
--- a/spec/helpers/table_builder_helper_spec.rb
+++ b/spec/helpers/table_builder_helper_spec.rb
@@ -81,6 +81,7 @@ describe TableBuilderHelper, type: :helper do
<li><a href="/referentials/#{referential.id}/edit">Editer</a></li>
<li><a href="/referentials/#{referential.id}/time_tables">Calendriers</a></li>
<li><a href="/referentials/new?from=#{referential.id}">Dupliquer</a></li>
+ <li><a href="/referentials/#{referential.id}/select_compliance_control_set">Valider</a></li>
<li><a rel="nofollow" data-method="put" href="/referentials/#{referential.id}/archive">Conserver</a></li>
<li class="delete-action"><a data-confirm="Etes vous sûr de vouloir supprimer ce jeu de données ?" rel="nofollow" data-method="delete" href="/referentials/#{referential.id}"><span class="fa fa-trash mr-xs"></span>Supprimer</a></li>
</ul>