Commit 699b6a02 authored by orozot's avatar orozot

Add unit test to ensure importable_repos return an array

parent 677873e2
......@@ -30,6 +30,14 @@ RSpec.describe Import::GitlabController do
expect(session[:gitlab_access_token]).to eq(token)
expect(controller).to redirect_to(status_import_gitlab_url)
end
it "importable_repos should return an array" do
allow_next_instance_of(Gitlab::GitlabImport::Client) do |instance|
allow(instance).to receive(:projects).and_return([{ "id": 1 }].to_enum)
end
expect(controller.send(:importable_repos)).to be_an_instance_of(Array)
end
end
describe "GET status" do
......
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