summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorJared Szechy <jared.szechy@brilligent.com>2015-08-04 18:21:12 -0400
committerJared Szechy <jared.szechy@brilligent.com>2015-09-08 20:23:01 -0400
commite156f42079ebf8247b6a39fa6314d4d5c6b73d12 (patch)
tree8a4c08adda59c7cdd09fb2164df43d8b950b0389 /spec/controllers
parent86556a079e34eb1267e63f7b39cc018665e21bfc (diff)
downloadgitlab-ce-e156f42079ebf8247b6a39fa6314d4d5c6b73d12.tar.gz
FogBugz project import
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/import/fogbugz_controller_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/controllers/import/fogbugz_controller_spec.rb b/spec/controllers/import/fogbugz_controller_spec.rb
new file mode 100644
index 00000000000..27b11267d2a
--- /dev/null
+++ b/spec/controllers/import/fogbugz_controller_spec.rb
@@ -0,0 +1,39 @@
+require 'spec_helper'
+require_relative 'import_spec_helper'
+
+describe Import::FogbugzController do
+ include ImportSpecHelper
+
+ let(:user) { create(:user) }
+
+ before do
+ sign_in(user)
+ end
+
+ describe 'GET status' do
+ before do
+ @repo = OpenStruct.new(name: 'vim')
+ stub_client(valid?: true)
+ end
+
+ it 'assigns variables' do
+ @project = create(:project, import_type: 'fogbugz', creator_id: user.id)
+ stub_client(repos: [@repo])
+
+ get :status
+
+ expect(assigns(:already_added_projects)).to eq([@project])
+ expect(assigns(:repos)).to eq([@repo])
+ end
+
+ it 'does not show already added project' do
+ @project = create(:project, import_type: 'fogbugz', creator_id: user.id, import_source: 'vim')
+ stub_client(repos: [@repo])
+
+ get :status
+
+ expect(assigns(:already_added_projects)).to eq([@project])
+ expect(assigns(:repos)).to eq([])
+ end
+ end
+end