fix specs
This commit is contained in:
parent
c2b33d3b71
commit
7085850c50
|
@ -12,8 +12,7 @@ require 'file_size_validator'
|
|||
|
||||
class ProjectImportData < ActiveRecord::Base
|
||||
belongs_to :project
|
||||
attr_encrypted :credentials, key: Gitlab::Application.secrets.db_key_base
|
||||
serialize :credentials, JSON
|
||||
attr_encrypted :credentials, key: Gitlab::Application.secrets.db_key_base, marshal: true
|
||||
|
||||
serialize :data, JSON
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@ module Gitlab
|
|||
credentials.values.join(":")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
FactoryGirl.define do
|
||||
factory :project_import_data, class: ProjectImportData do
|
||||
data "test"
|
||||
end
|
||||
end
|
|
@ -12,7 +12,7 @@ describe Gitlab::GithubImport::ProjectCreator, lib: true do
|
|||
owner: OpenStruct.new(login: "john")
|
||||
)
|
||||
end
|
||||
let(:namespace){ create(:group, owner: user) }
|
||||
let(:namespace) { create(:group, owner: user) }
|
||||
let(:token) { "asdffg" }
|
||||
let(:access_params) { { github_access_token: token } }
|
||||
|
||||
|
@ -27,7 +27,7 @@ describe Gitlab::GithubImport::ProjectCreator, lib: true do
|
|||
project = project_creator.execute
|
||||
|
||||
expect(project.import_url).to eq("https://gitlab.com/asd/vim.git")
|
||||
expect(project.import_data.credentials).to eq("asdffg")
|
||||
expect(project.import_data.credentials).to eq(:github_access_token => "asdffg")
|
||||
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,10 +3,15 @@ require 'spec_helper'
|
|||
describe Gitlab::GithubImport::WikiFormatter, lib: true do
|
||||
let(:project) do
|
||||
create(:project, namespace: create(:namespace, path: 'gitlabhq'),
|
||||
import_url: 'https://xxx@github.com/gitlabhq/sample.gitlabhq.git')
|
||||
import_url: 'https://github.com/gitlabhq/sample.gitlabhq.git')
|
||||
end
|
||||
|
||||
subject(:wiki) { described_class.new(project)}
|
||||
let!(:project_import_data) do
|
||||
create(:project_import_data, credentials: { github_access_token: 'xxx' },
|
||||
project: project)
|
||||
end
|
||||
|
||||
subject(:wiki) { described_class.new(project) }
|
||||
|
||||
describe '#path_with_namespace' do
|
||||
it 'appends .wiki to project path' do
|
||||
|
|
Loading…
Reference in New Issue