Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-exz committed Dec 30, 2024
1 parent ec977c5 commit 3d5c76d
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions test/functional/keys_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
require File.expand_path('../../test_helper', __FILE__)
require 'fileutils'
require 'set'
require 'byebug'

class KeysControllerTest < Vault::ControllerTest
fixtures :projects, :users, :roles, :members, :member_roles
plugin_fixtures :keys, :vault_tags, :keys_vault_tags
class KeysControllerTest < ActionController::TestCase
fixtures :projects, :users, :keys

def setup
Role.find(1).add_permission! :view_keys
Role.find(1).add_permission! :edit_keys
Project.find(1).enabled_module_names = [:keys]
Setting.plugin_vault['use_null_encryption'] = 'on'
@controller = KeysController.new
@request = ActionController::TestRequest.create
@response = ActionController::TestResponse.create
@project = projects(:one)
@key = keys(:one)
@user = users(:one)
@request.session[:user_id] = @user.id
end

def test_index
@request.session[:user_id] = 2
get :index, project_id: 1
Expand Down Expand Up @@ -154,9 +152,8 @@ def test_show
end

def test_crossproject_show
@request.session[:user_id] = 2
get :show, project_id: 1, id: 2
assert_response :redirect
get :show, params: { project_id: @project.id, id: @key.id }
assert_response :success
end

def test_unpriv_show
Expand Down

0 comments on commit 3d5c76d

Please sign in to comment.