Skip to content

Commit

Permalink
Adjust repositories controller rspec for bootstrap DoD migration
Browse files Browse the repository at this point in the history
The new bootstrap view redirects the user after a DoD repository
gets created. The test expects a 200 http code instead of a 302.
  • Loading branch information
krauselukas authored and bgeuken committed Dec 6, 2018
1 parent f263fe8 commit e90726f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/api/spec/controllers/webui/repositories_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@
end

it { expect(assigns(:error)).to start_with('Repository with name') }
it { expect(response).to have_http_status(:success) }
# FIXME: Remove 'have_http_status(:success)' after old webui got dropped
it { expect(response).to have_http_status(:success).or(have_http_status(:redirect)) }
end

context 'with no valid repository type' do
Expand All @@ -204,7 +205,8 @@
end

it { expect(assigns(:error)).to start_with("Couldn't add repository:") }
it { expect(response).to have_http_status(:success) }
# FIXME: Remove 'have_http_status(:success)' after old webui got dropped
it { expect(response).to have_http_status(:success).or(have_http_status(:redirect)) }
end

context 'with no valid repository Architecture' do
Expand All @@ -216,7 +218,8 @@
end

it { expect(assigns(:error)).to start_with("Couldn't add repository:") }
it { expect(response).to have_http_status(:success) }
# FIXME: Remove 'have_http_status(:success)' after old webui got dropped
it { expect(response).to have_http_status(:success).or(have_http_status(:redirect)) }
end

context 'with valid repository data' do
Expand All @@ -228,7 +231,8 @@
end

it { expect(assigns(:error)).to be_nil }
it { expect(response).to have_http_status(:success) }
# FIXME: Remove 'have_http_status(:success)' after old webui got dropped
it { expect(response).to have_http_status(:success).or(have_http_status(:redirect)) }
end
end

Expand Down

0 comments on commit e90726f

Please sign in to comment.