Commit acb3af6d authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-20

# Conflicts:
#	config/webpack.config.js
#	features/steps/project/network_graph.rb

[ci skip]
parents d4e631df 5048c8d5
class Deployment < ActiveRecord::Base
include InternalId
belongs_to :project, required: true, validate: true
belongs_to :environment, required: true, validate: true
belongs_to :project, required: true
belongs_to :environment, required: true
belongs_to :user
belongs_to :deployable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
......
......@@ -4,7 +4,7 @@ class Environment < ActiveRecord::Base
NUMBERS = '0'..'9'
SUFFIX_CHARS = LETTERS.to_a + NUMBERS.to_a
belongs_to :project, required: true, validate: true
belongs_to :project, required: true
has_many :deployments, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
......
---
title: 'Remove unecessary validate: true from belongs_to :project'
merge_request:
author:
type: fixed
......@@ -66,7 +66,10 @@ var config = {
epic_show: 'ee/epics/epic_show/epic_show_bundle.js',
new_epic: 'ee/epics/new_epic/new_epic_bundle.js',
filtered_search: './filtered_search/filtered_search_bundle.js',
<<<<<<< HEAD
geo_nodes: 'ee/geo_nodes',
=======
>>>>>>> upstream/master
help: './help/help.js',
issuable: './issuable/issuable_bundle.js',
issues: './issues/issues_bundle.js',
......
Feature: Project Network Graph
Background:
Given I sign in as a user
And I own project "Shop"
And I visit project "Shop" network page
@javascript
Scenario: I should see project network
Then page should have network graph
And page should select "master" in select box
And page should have "master" on graph
@javascript
Scenario: I should see project network with 'test' branch
When I visit project network page on branch 'test'
Then page should have 'test' on graph
@javascript
Scenario: I should switch "branch" and "tag"
When I switch ref to "feature"
Then page should select "feature" in select box
And page should have "feature" on graph
When I switch ref to "v1.0.0"
Then page should select "v1.0.0" in select box
And page should have "v1.0.0" on graph
@javascript
Scenario: I should looking for a commit by SHA
When I looking for a commit by SHA of "v1.0.0"
Then page should have network graph
And page should select "master" in select box
And page should have "v1.0.0" on graph
@javascript
Scenario: I should filter selected tag
When I switch ref to "v1.0.0"
Then page should have "v1.0.0" in title
Then page should have content not containing "v1.0.0"
When click "Show only selected branch" checkbox
Then page should only have content from "v1.0.0"
When click "Show only selected branch" checkbox
Then page should have content not containing "v1.0.0"
Scenario: I should fail to look for a commit
When I look for a commit by ";"
Then I should see non-existent git revision error message
require 'spec_helper'
describe 'Project Network Graph', :js do
let(:user) { create :user }
let(:project) { create :project, :repository, namespace: user.namespace }
before do
sign_in(user)
# Stub Graph max_size to speed up test (10 commits vs. 650)
allow(Network::Graph).to receive(:max_count).and_return(10)
end
context 'when branch is master' do
def switch_ref_to(ref_name)
first('.js-project-refs-dropdown').click
page.within '.project-refs-form' do
click_link ref_name
end
end
def click_show_only_selected_branch_checkbox
find('#filter_ref').click
end
before do
visit project_network_path(project, 'master')
end
it 'renders project network' do
expect(page).to have_selector ".network-graph"
expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
page.within '.network-graph' do
expect(page).to have_content 'master'
end
end
it 'switches ref to branch' do
switch_ref_to('feature')
expect(page).to have_selector '.dropdown-menu-toggle', text: 'feature'
page.within '.network-graph' do
expect(page).to have_content 'feature'
end
end
it 'switches ref to tag' do
switch_ref_to('v1.0.0')
expect(page).to have_selector '.dropdown-menu-toggle', text: 'v1.0.0'
page.within '.network-graph' do
expect(page).to have_content 'v1.0.0'
end
end
it 'renders by commit sha of "v1.0.0"' do
page.within ".network-form" do
fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
find('button').click
end
expect(page).to have_selector ".network-graph"
expect(page).to have_selector '.dropdown-menu-toggle', text: "master"
page.within '.network-graph' do
expect(page).to have_content 'v1.0.0'
end
end
it 'filters select tag' do
switch_ref_to('v1.0.0')
expect(page).to have_css 'title', text: 'Graph · v1.0.0', visible: false
page.within '.network-graph' do
expect(page).to have_content 'Change some files'
end
click_show_only_selected_branch_checkbox
page.within '.network-graph' do
expect(page).not_to have_content 'Change some files'
end
click_show_only_selected_branch_checkbox
page.within '.network-graph' do
expect(page).to have_content 'Change some files'
end
end
it 'renders error message when sha commit not exists' do
page.within ".network-form" do
fill_in 'extended_sha1', with: ';'
find('button').click
end
expect(page).to have_selector '.flash-alert', text: "Git revision ';' does not exist."
end
end
it 'renders project network with test branch' do
visit project_network_path(project, "'test'")
page.within '.network-graph' do
expect(page).to have_content "'test'"
end
end
end
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