aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features
diff options
context:
space:
mode:
authorRobert2017-09-15 00:07:38 +0200
committerRobert2017-09-15 10:47:04 +0200
commit178cc4910932b134688392247d39a6bc92abde41 (patch)
tree690e79322a6cef6f6e761adf0a10e7f50b123e29 /spec/features
parent41a054b9724ab063cc3568d10113af3ec5203864 (diff)
downloadchouette-core-178cc4910932b134688392247d39a6bc92abde41.tar.bz2
Refs: #4446@0.3h; Integrated Policy Specs of #4442 and adapting them to the needs of #4446
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/api_keys/delete_api_key_feature_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/features/api_keys/delete_api_key_feature_spec.rb b/spec/features/api_keys/delete_api_key_feature_spec.rb
new file mode 100644
index 000000000..8d4f57806
--- /dev/null
+++ b/spec/features/api_keys/delete_api_key_feature_spec.rb
@@ -0,0 +1,34 @@
+RSpec.describe 'New API Key', type: :feature do
+ login_user
+
+ describe "api_keys#destroy" do
+
+ let!( :api_key ){ create :api_key, name: SecureRandom.uuid, organisation: @user.organisation }
+
+ let( :edit_label ){ "#{api_key.name} : #{api_key.token}" }
+ let( :destroy_label ){ "Supprimer" }
+
+ it 'complete workflow' do
+ # /workbenches
+ visit workbenches_path
+ # the api_key is visible
+ click_link edit_label
+
+ # brings us to correct page
+ expect(page.current_path).to eq(edit_api_key_path(api_key))
+ expect(page).to have_content("Supprimer")
+ # click_link(destroy_label)
+
+ # # check impact on DB
+ # expect(Api::V1::ApiKey.where(id: api_key.id)).to be_empty
+
+ # # check redirect and changed display
+ # expect(page.current_path).to eq(workbenches_path)
+ # # deleted api_key's not shown anymore
+ # expect( page ).not_to have_content(edit_label)
+ end
+
+ end
+
+end
+