diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-10 13:13:01 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-10 13:13:01 +0100 |
commit | a6997e339be703e769b32765ffbdbf722ac2aea5 (patch) | |
tree | a39e76580ffa460349f509f169cc44b1fe9d8f54 /spec/controllers | |
parent | e4b30f9db3d0b2a2d3b7274d312872fe41d22104 (diff) | |
parent | dadf6daac47badf01a7a0bac94527a4d68555db6 (diff) | |
download | gitlab-ce-a6997e339be703e769b32765ffbdbf722ac2aea5.tar.gz |
Merge branch 'master' into dashboard-titlesdashboard-titles
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/import/fogbugz_controller_spec.rb | 39 |
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 |