I like it :+1:
-diff --git a/.foreman b/.foreman
deleted file mode 100644
index 87c3f5a1c158686373e3179b503b0a7b7987587b..0000000000000000000000000000000000000000
--- a/.foreman
+++ /dev/null
@@ -1 +0,0 @@
-port: 3000
diff --git a/.hound.yml b/.hound.yml
deleted file mode 100644
index 3bde29fb2bf974a6345220ff6d7ac4247e1e4621..0000000000000000000000000000000000000000
--- a/.hound.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-# Prefer single quotes
-StringLiterals:
- EnforcedStyle: single_quotes
- Enabled: true
diff --git a/.pkgr.yml b/.pkgr.yml
deleted file mode 100644
index 8fc9fddf8f79d5f5dc391732879b307712d201cf..0000000000000000000000000000000000000000
--- a/.pkgr.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-user: git
-group: git
-services:
- - postgres
-before_precompile: ./bin/pkgr_before_precompile.sh
-targets:
- debian-7: &wheezy
- build_dependencies:
- - libkrb5-dev
- - libicu-dev
- - cmake
- - pkg-config
- dependencies:
- - libicu48
- - libpcre3
- - git
- ubuntu-12.04: *wheezy
- ubuntu-14.04:
- build_dependencies:
- - libkrb5-dev
- - libicu-dev
- - cmake
- - pkg-config
- dependencies:
- - libicu52
- - libpcre3
- - git
- centos-6:
- build_dependencies:
- - krb5-devel
- - libicu-devel
- - cmake
- - pkgconfig
- dependencies:
- - libicu
- - pcre
- - git
diff --git a/.rspec b/.rspec
deleted file mode 100644
index 4e1e0d2f722485c7d284fb5cd7da855826e39b5a..0000000000000000000000000000000000000000
--- a/.rspec
+++ /dev/null
@@ -1 +0,0 @@
---color
diff --git a/.rubocop.yml b/.rubocop.yml
deleted file mode 100644
index 03b78d6884016d3cca875d16414e521914703a73..0000000000000000000000000000000000000000
--- a/.rubocop.yml
+++ /dev/null
@@ -1,1006 +0,0 @@
-Style/AccessModifierIndentation:
- Description: Check indentation of private/protected visibility modifiers.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
- Enabled: true
-
-Style/AccessorMethodName:
- Description: Check the naming of accessor methods for get_/set_.
- Enabled: false
-
-Style/Alias:
- Description: 'Use alias_method instead of alias.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
- Enabled: true
-
-Style/AlignArray:
- Description: >-
- Align the elements of an array literal if they span more than
- one line.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
- Enabled: true
-
-Style/AlignHash:
- Description: >-
- Align the elements of a hash literal if they span more than
- one line.
- Enabled: true
-
-Style/AlignParameters:
- Description: >-
- Align the parameters of a method call if they span more
- than one line.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
- Enabled: false
-
-Style/AndOr:
- Description: 'Use &&/|| instead of and/or.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
- Enabled: false
-
-Style/ArrayJoin:
- Description: 'Use Array#join instead of Array#*.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
- Enabled: false
-
-Style/AsciiComments:
- Description: 'Use only ascii symbols in comments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
- Enabled: true
-
-Style/AsciiIdentifiers:
- Description: 'Use only ascii symbols in identifiers.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
- Enabled: true
-
-Style/Attr:
- Description: 'Checks for uses of Module#attr.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
- Enabled: false
-
-Style/BeginBlock:
- Description: 'Avoid the use of BEGIN blocks.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
- Enabled: true
-
-Style/BarePercentLiterals:
- Description: 'Checks if usage of %() or %Q() matches configuration.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
- Enabled: false
-
-Style/BlockComments:
- Description: 'Do not use block comments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
- Enabled: false
-
-Style/BlockEndNewline:
- Description: 'Put end statement of multiline block on its own line.'
- Enabled: true
-
-Style/Blocks:
- Description: >-
- Avoid using {...} for multi-line blocks (multiline chaining is
- always ugly).
- Prefer {...} over do...end for single-line blocks.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
- Enabled: true
-
-Style/BracesAroundHashParameters:
- Description: 'Enforce braces style around hash parameters.'
- Enabled: false
-
-Style/CaseEquality:
- Description: 'Avoid explicit use of the case equality operator(===).'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
- Enabled: false
-
-Style/CaseIndentation:
- Description: 'Indentation of when in a case/when/[else/]end.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
- Enabled: true
-
-Style/CharacterLiteral:
- Description: 'Checks for uses of character literals.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
- Enabled: true
-
-Style/ClassAndModuleCamelCase:
- Description: 'Use CamelCase for classes and modules.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
- Enabled: true
-
-Style/ClassAndModuleChildren:
- Description: 'Checks style of children classes and modules.'
- Enabled: false
-
-Style/ClassCheck:
- Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
- Enabled: false
-
-Style/ClassMethods:
- Description: 'Use self when defining module/class methods.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
- Enabled: false
-
-Style/ClassVars:
- Description: 'Avoid the use of class variables.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
- Enabled: true
-
-Style/ColonMethodCall:
- Description: 'Do not use :: for method call.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
- Enabled: false
-
-Style/CommentAnnotation:
- Description: >-
- Checks formatting of special comments
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
- Enabled: false
-
-Style/CommentIndentation:
- Description: 'Indentation of comments.'
- Enabled: true
-
-Style/ConstantName:
- Description: 'Constants should use SCREAMING_SNAKE_CASE.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
- Enabled: true
-
-Style/DefWithParentheses:
- Description: 'Use def with parentheses when there are arguments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
- Enabled: false
-
-Style/DeprecatedHashMethods:
- Description: 'Checks for use of deprecated Hash methods.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
- Enabled: false
-
-Style/Documentation:
- Description: 'Document classes and non-namespace modules.'
- Enabled: false
-
-Style/DotPosition:
- Description: 'Checks the position of the dot in multi-line method calls.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
- Enabled: false
-
-Style/DoubleNegation:
- Description: 'Checks for uses of double negation (!!).'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
- Enabled: false
-
-Style/EachWithObject:
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
- Enabled: false
-
-Style/ElseAlignment:
- Description: 'Align elses and elsifs correctly.'
- Enabled: true
-
-Style/EmptyElse:
- Description: 'Avoid empty else-clauses.'
- Enabled: false
-
-Style/EmptyLineBetweenDefs:
- Description: 'Use empty lines between defs.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
- Enabled: false
-
-Style/EmptyLines:
- Description: "Don't use several empty lines in a row."
- Enabled: false
-
-Style/EmptyLinesAroundAccessModifier:
- Description: "Keep blank lines around access modifiers."
- Enabled: false
-
-Style/EmptyLinesAroundBlockBody:
- Description: "Keeps track of empty lines around block bodies."
- Enabled: false
-
-Style/EmptyLinesAroundClassBody:
- Description: "Keeps track of empty lines around class bodies."
- Enabled: false
-
-Style/EmptyLinesAroundModuleBody:
- Description: "Keeps track of empty lines around module bodies."
- Enabled: false
-
-Style/EmptyLinesAroundMethodBody:
- Description: "Keeps track of empty lines around method bodies."
- Enabled: false
-
-Style/EmptyLiteral:
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
- Enabled: false
-
-Style/EndBlock:
- Description: 'Avoid the use of END blocks.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
- Enabled: false
-
-Style/EndOfLine:
- Description: 'Use Unix-style line endings.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
- Enabled: false
-
-Style/EvenOdd:
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
- Enabled: false
-
-Style/FileName:
- Description: 'Use snake_case for source file names.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
- Enabled: false
-
-Style/FlipFlop:
- Description: 'Checks for flip flops'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
- Enabled: false
-
-Style/For:
- Description: 'Checks use of for or each in multiline loops.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
- Enabled: false
-
-Style/FormatString:
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
- Enabled: false
-
-Style/GlobalVars:
- Description: 'Do not introduce global variables.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
- Enabled: false
-
-Style/GuardClause:
- Description: 'Check for conditionals that can be replaced with guard clauses'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
- Enabled: false
-
-Style/HashSyntax:
- Description: >-
- Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
- { :a => 1, :b => 2 }.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
- Enabled: true
-
-Style/IfUnlessModifier:
- Description: >-
- Favor modifier if/unless usage when you have a
- single-line body.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
- Enabled: false
-
-Style/IfWithSemicolon:
- Description: 'Do not use if x; .... Use the ternary operator instead.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
- Enabled: false
-
-Style/IndentationConsistency:
- Description: 'Keep indentation straight.'
- Enabled: true
-
-Style/IndentationWidth:
- Description: 'Use 2 spaces for indentation.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
- Enabled: true
-
-Style/IndentArray:
- Description: >-
- Checks the indentation of the first element in an array
- literal.
- Enabled: false
-
-Style/IndentHash:
- Description: 'Checks the indentation of the first key in a hash literal.'
- Enabled: false
-
-Style/InfiniteLoop:
- Description: 'Use Kernel#loop for infinite loops.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
- Enabled: false
-
-Style/Lambda:
- Description: 'Use the new lambda literal syntax for single-line blocks.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
- Enabled: false
-
-Style/LambdaCall:
- Description: 'Use lambda.call(...) instead of lambda.(...).'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
- Enabled: false
-
-Style/LeadingCommentSpace:
- Description: 'Comments should start with a space.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
- Enabled: false
-
-Style/LineEndConcatenation:
- Description: >-
- Use \ instead of + or << to concatenate two string literals at
- line end.
- Enabled: false
-
-Style/MethodCallParentheses:
- Description: 'Do not use parentheses for method calls with no arguments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
- Enabled: false
-
-Style/MethodDefParentheses:
- Description: >-
- Checks if the method definitions have or don't have
- parentheses.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
- Enabled: false
-
-Style/MethodName:
- Description: 'Use the configured style when naming methods.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
- Enabled: false
-
-Style/ModuleFunction:
- Description: 'Checks for usage of `extend self` in modules.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
- Enabled: false
-
-Style/MultilineBlockChain:
- Description: 'Avoid multi-line chains of blocks.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
- Enabled: false
-
-Style/MultilineBlockLayout:
- Description: 'Ensures newlines after multiline block do statements.'
- Enabled: true
-
-Style/MultilineIfThen:
- Description: 'Do not use then for multi-line if/unless.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
- Enabled: false
-
-Style/MultilineOperationIndentation:
- Description: >-
- Checks indentation of binary operations that span more than
- one line.
- Enabled: false
-
-Style/MultilineTernaryOperator:
- Description: >-
- Avoid multi-line ?: (the ternary operator);
- use if/unless instead.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
- Enabled: false
-
-Style/NegatedIf:
- Description: >-
- Favor unless over if for negative conditions
- (or control flow or).
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
- Enabled: false
-
-Style/NegatedWhile:
- Description: 'Favor until over while for negative conditions.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
- Enabled: false
-
-Style/NestedTernaryOperator:
- Description: 'Use one expression per branch in a ternary operator.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
- Enabled: true
-
-Style/Next:
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
- Enabled: false
-
-Style/NilComparison:
- Description: 'Prefer x.nil? to x == nil.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
- Enabled: true
-
-Style/NonNilCheck:
- Description: 'Checks for redundant nil checks.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
- Enabled: true
-
-Style/Not:
- Description: 'Use ! instead of not.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
- Enabled: true
-
-Style/NumericLiterals:
- Description: >-
- Add underscores to large numeric literals to improve their
- readability.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
- Enabled: false
-
-Style/OneLineConditional:
- Description: >-
- Favor the ternary operator(?:) over
- if/then/else/end constructs.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
- Enabled: true
-
-Style/OpMethod:
- Description: 'When defining binary operators, name the argument other.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
- Enabled: false
-
-Style/ParenthesesAroundCondition:
- Description: >-
- Don't use parentheses around the condition of an
- if/unless/while.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
- Enabled: true
-
-Style/PercentLiteralDelimiters:
- Description: 'Use `%`-literal delimiters consistently'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
- Enabled: false
-
-Style/PercentQLiterals:
- Description: 'Checks if uses of %Q/%q match the configured preference.'
- Enabled: false
-
-Style/PerlBackrefs:
- Description: 'Avoid Perl-style regex back references.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
- Enabled: false
-
-Style/PredicateName:
- Description: 'Check the names of predicate methods.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
- Enabled: false
-
-Style/Proc:
- Description: 'Use proc instead of Proc.new.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
- Enabled: false
-
-Style/RaiseArgs:
- Description: 'Checks the arguments passed to raise/fail.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
- Enabled: false
-
-Style/RedundantBegin:
- Description: "Don't use begin blocks when they are not needed."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
- Enabled: false
-
-Style/RedundantException:
- Description: "Checks for an obsolete RuntimeException argument in raise/fail."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
- Enabled: false
-
-Style/RedundantReturn:
- Description: "Don't use return where it's not required."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
- Enabled: true
-
-Style/RedundantSelf:
- Description: "Don't use self where it's not needed."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
- Enabled: false
-
-Style/RegexpLiteral:
- Description: >-
- Use %r for regular expressions matching more than
- `MaxSlashes` '/' characters.
- Use %r only for regular expressions matching more than
- `MaxSlashes` '/' character.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
- Enabled: false
-
-Style/RescueModifier:
- Description: 'Avoid using rescue in its modifier form.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
- Enabled: false
-
-Style/SelfAssignment:
- Description: >-
- Checks for places where self-assignment shorthand should have
- been used.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
- Enabled: false
-
-Style/Semicolon:
- Description: "Don't use semicolons to terminate expressions."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
- Enabled: false
-
-Style/SignalException:
- Description: 'Checks for proper usage of fail and raise.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
- Enabled: false
-
-Style/SingleLineBlockParams:
- Description: 'Enforces the names of some block params.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
- Enabled: false
-
-Style/SingleLineMethods:
- Description: 'Avoid single-line methods.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
- Enabled: false
-
-Style/SingleSpaceBeforeFirstArg:
- Description: >-
- Checks that exactly one space is used between a method name
- and the first argument for method calls without parentheses.
- Enabled: false
-
-Style/SpaceAfterColon:
- Description: 'Use spaces after colons.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
- Enabled: false
-
-Style/SpaceAfterComma:
- Description: 'Use spaces after commas.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
- Enabled: false
-
-Style/SpaceAfterControlKeyword:
- Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
- Enabled: false
-
-Style/SpaceAfterMethodName:
- Description: >-
- Do not put a space between a method name and the opening
- parenthesis in a method definition.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
- Enabled: false
-
-Style/SpaceAfterNot:
- Description: Tracks redundant space after the ! operator.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
- Enabled: false
-
-Style/SpaceAfterSemicolon:
- Description: 'Use spaces after semicolons.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
- Enabled: false
-
-Style/SpaceBeforeBlockBraces:
- Description: >-
- Checks that the left block brace has or doesn't have space
- before it.
- Enabled: false
-
-Style/SpaceBeforeComma:
- Description: 'No spaces before commas.'
- Enabled: false
-
-Style/SpaceBeforeComment:
- Description: >-
- Checks for missing space between code and a comment on the
- same line.
- Enabled: false
-
-Style/SpaceBeforeSemicolon:
- Description: 'No spaces before semicolons.'
- Enabled: false
-
-Style/SpaceInsideBlockBraces:
- Description: >-
- Checks that block braces have or don't have surrounding space.
- For blocks taking parameters, checks that the left brace has
- or doesn't have trailing space.
- Enabled: false
-
-Style/SpaceAroundEqualsInParameterDefault:
- Description: >-
- Checks that the equals signs in parameter default assignments
- have or don't have surrounding space depending on
- configuration.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
- Enabled: false
-
-Style/SpaceAroundOperators:
- Description: 'Use spaces around operators.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
- Enabled: false
-
-Style/SpaceBeforeModifierKeyword:
- Description: 'Put a space before the modifier keyword.'
- Enabled: false
-
-Style/SpaceInsideBrackets:
- Description: 'No spaces after [ or before ].'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
- Enabled: false
-
-Style/SpaceInsideHashLiteralBraces:
- Description: "Use spaces inside hash literal braces - or don't."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
- Enabled: true
-
-Style/SpaceInsideParens:
- Description: 'No spaces after ( or before ).'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
- Enabled: false
-
-Style/SpaceInsideRangeLiteral:
- Description: 'No spaces inside range literals.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
- Enabled: false
-
-Style/SpecialGlobalVars:
- Description: 'Avoid Perl-style global variables.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
- Enabled: false
-
-Style/StringLiterals:
- Description: 'Checks if uses of quotes match the configured preference.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
- Enabled: false
-
-Style/StringLiteralsInInterpolation:
- Description: >-
- Checks if uses of quotes inside expressions in interpolated
- strings match the configured preference.
- Enabled: false
-
-Style/SymbolProc:
- Description: 'Use symbols as procs instead of blocks when possible.'
- Enabled: false
-
-Style/Tab:
- Description: 'No hard tabs.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
- Enabled: true
-
-Style/TrailingBlankLines:
- Description: 'Checks trailing blank lines and final newline.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
- Enabled: true
-
-Style/TrailingComma:
- Description: 'Checks for trailing comma in parameter lists and literals.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
- Enabled: false
-
-Style/TrailingWhitespace:
- Description: 'Avoid trailing whitespace.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
- Enabled: false
-
-Style/TrivialAccessors:
- Description: 'Prefer attr_* methods to trivial readers/writers.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
- Enabled: false
-
-Style/UnlessElse:
- Description: >-
- Do not use unless with else. Rewrite these with the positive
- case first.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
- Enabled: false
-
-Style/UnneededCapitalW:
- Description: 'Checks for %W when interpolation is not needed.'
- Enabled: false
-
-Style/UnneededPercentQ:
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
- Enabled: false
-
-Style/UnneededPercentX:
- Description: 'Checks for %x when `` would do.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
- Enabled: false
-
-Style/VariableInterpolation:
- Description: >-
- Don't interpolate global, instance and class variables
- directly in strings.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
- Enabled: false
-
-Style/VariableName:
- Description: 'Use the configured style when naming variables.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
- Enabled: false
-
-Style/WhenThen:
- Description: 'Use when x then ... for one-line cases.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
- Enabled: false
-
-Style/WhileUntilDo:
- Description: 'Checks for redundant do after while or until.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
- Enabled: false
-
-Style/WhileUntilModifier:
- Description: >-
- Favor modifier while/until usage when you have a
- single-line body.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
- Enabled: false
-
-Style/WordArray:
- Description: 'Use %w or %W for arrays of words.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
- Enabled: false
-
-#################### Metrics ################################
-
-Metrics/AbcSize:
- Description: >-
- A calculated magnitude based on number of assignments,
- branches, and conditions.
- Enabled: false
-
-Metrics/BlockNesting:
- Description: 'Avoid excessive block nesting'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
- Enabled: false
-
-Metrics/ClassLength:
- Description: 'Avoid classes longer than 100 lines of code.'
- Enabled: false
-
-Metrics/CyclomaticComplexity:
- Description: >-
- A complexity metric that is strongly correlated to the number
- of test cases needed to validate a method.
- Enabled: false
-
-Metrics/LineLength:
- Description: 'Limit lines to 80 characters.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
- Enabled: false
-
-Metrics/MethodLength:
- Description: 'Avoid methods longer than 10 lines of code.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
- Enabled: false
-
-Metrics/ParameterLists:
- Description: 'Avoid parameter lists longer than three or four parameters.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
- Enabled: false
-
-Metrics/PerceivedComplexity:
- Description: >-
- A complexity metric geared towards measuring complexity for a
- human reader.
- Enabled: false
-
-#################### Lint ################################
-### Warnings
-
-Lint/AmbiguousOperator:
- Description: >-
- Checks for ambiguous operators in the first argument of a
- method invocation without parentheses.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
- Enabled: false
-
-Lint/AmbiguousRegexpLiteral:
- Description: >-
- Checks for ambiguous regexp literals in the first argument of
- a method invocation without parenthesis.
- Enabled: false
-
-Lint/AssignmentInCondition:
- Description: "Don't use assignment in conditions."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
- Enabled: false
-
-Lint/BlockAlignment:
- Description: 'Align block ends correctly.'
- Enabled: false
-
-Lint/ConditionPosition:
- Description: >-
- Checks for condition placed in a confusing position relative to
- the keyword.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
- Enabled: false
-
-Lint/Debugger:
- Description: 'Check for debugger calls.'
- Enabled: false
-
-Lint/DefEndAlignment:
- Description: 'Align ends corresponding to defs correctly.'
- Enabled: false
-
-Lint/DeprecatedClassMethods:
- Description: 'Check for deprecated class method calls.'
- Enabled: false
-
-Lint/ElseLayout:
- Description: 'Check for odd code arrangement in an else block.'
- Enabled: false
-
-Lint/EmptyEnsure:
- Description: 'Checks for empty ensure block.'
- Enabled: false
-
-Lint/EmptyInterpolation:
- Description: 'Checks for empty string interpolation.'
- Enabled: false
-
-Lint/EndAlignment:
- Description: 'Align ends correctly.'
- Enabled: false
-
-Lint/EndInMethod:
- Description: 'END blocks should not be placed inside method definitions.'
- Enabled: false
-
-Lint/EnsureReturn:
- Description: 'Do not use return in an ensure block.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
- Enabled: false
-
-Lint/Eval:
- Description: 'The use of eval represents a serious security risk.'
- Enabled: false
-
-Lint/HandleExceptions:
- Description: "Don't suppress exception."
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
- Enabled: false
-
-Lint/InvalidCharacterLiteral:
- Description: >-
- Checks for invalid character literals with a non-escaped
- whitespace character.
- Enabled: false
-
-Lint/LiteralInCondition:
- Description: 'Checks of literals used in conditions.'
- Enabled: false
-
-Lint/LiteralInInterpolation:
- Description: 'Checks for literals used in interpolation.'
- Enabled: false
-
-Lint/Loop:
- Description: >-
- Use Kernel#loop with break rather than begin/end/until or
- begin/end/while for post-loop tests.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
- Enabled: false
-
-Lint/ParenthesesAsGroupedExpression:
- Description: >-
- Checks for method calls with a space before the opening
- parenthesis.
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
- Enabled: true
-
-Lint/RequireParentheses:
- Description: >-
- Use parentheses in the method call to avoid confusion
- about precedence.
- Enabled: false
-
-Lint/RescueException:
- Description: 'Avoid rescuing the Exception class.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
- Enabled: false
-
-Lint/ShadowingOuterLocalVariable:
- Description: >-
- Do not use the same name as outer local variable
- for block arguments or block local variables.
- Enabled: false
-
-Lint/SpaceBeforeFirstArg:
- Description: >-
- Put a space between a method name and the first argument
- in a method call without parentheses.
- Enabled: false
-
-Lint/StringConversionInInterpolation:
- Description: 'Checks for Object#to_s usage in string interpolation.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
- Enabled: false
-
-Lint/UnderscorePrefixedVariableName:
- Description: 'Do not use prefix `_` for a variable that is used.'
- Enabled: true
-
-Lint/UnusedBlockArgument:
- Description: 'Checks for unused block arguments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
- Enabled: false
-
-Lint/UnusedMethodArgument:
- Description: 'Checks for unused method arguments.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
- Enabled: false
-
-Lint/UnreachableCode:
- Description: 'Unreachable code.'
- Enabled: false
-
-Lint/UselessAccessModifier:
- Description: 'Checks for useless access modifiers.'
- Enabled: false
-
-Lint/UselessAssignment:
- Description: 'Checks for useless assignment to a local variable.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
- Enabled: false
-
-Lint/UselessComparison:
- Description: 'Checks for comparison of something with itself.'
- Enabled: false
-
-Lint/UselessElseWithoutRescue:
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
- Enabled: false
-
-Lint/UselessSetterCall:
- Description: 'Checks for useless setter call to a local variable.'
- Enabled: false
-
-Lint/Void:
- Description: 'Possible use of operator/literal/variable in void context.'
- Enabled: false
-
-##################### Rails ##################################
-
-Rails/ActionFilter:
- Description: 'Enforces consistent use of action filter methods.'
- Enabled: false
-
-Rails/DefaultScope:
- Description: 'Checks if the argument passed to default_scope is a block.'
- Enabled: false
-
-Rails/Delegate:
- Description: 'Prefer delegate method for delegations.'
- Enabled: false
-
-Rails/HasAndBelongsToMany:
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
- Enabled: true
-
-Rails/Output:
- Description: 'Checks for calls to puts, print, etc.'
- Enabled: true
-
-Rails/ReadWriteAttribute:
- Description: >-
- Checks for read_attribute(:attr) and
- write_attribute(:attr, val).
- Enabled: false
-
-Rails/ScopeArgs:
- Description: 'Checks the arguments of ActiveRecord scopes.'
- Enabled: false
-
-Rails/Validation:
- Description: 'Use validates :attribute, hash of validations.'
- Enabled: false
-
-
-# Exclude some of GitLab files
-#
-#
-AllCops:
- RunRailsCops: true
- Exclude:
- - 'spec/**/*'
- - 'features/**/*'
- - 'vendor/**/*'
- - 'db/**/*'
- - 'tmp/**/*'
- - 'bin/**/*'
- - 'lib/backup/**/*'
- - 'lib/tasks/**/*'
- - 'lib/email_validator.rb'
- - 'lib/gitlab/upgrader.rb'
- - 'lib/gitlab/seeder.rb'
diff --git a/.ruby-version b/.ruby-version
deleted file mode 100644
index 399088bf465606fc2257b2741338f95e9c790390..0000000000000000000000000000000000000000
--- a/.ruby-version
+++ /dev/null
@@ -1 +0,0 @@
-2.1.6
diff --git a/.simplecov b/.simplecov
deleted file mode 100644
index d979288df44bfa11d3bbc74b52bae975631a4dbf..0000000000000000000000000000000000000000
--- a/.simplecov
+++ /dev/null
@@ -1,4 +0,0 @@
-# .simplecov
-SimpleCov.start 'rails' do
- merge_timeout 3600
-end
diff --git a/.teatro.yml b/.teatro.yml
deleted file mode 100644
index 3005436198154fbc3f812f0b51a26500d37391b7..0000000000000000000000000000000000000000
--- a/.teatro.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-stage:
- before:
- - cp config/gitlab.teatro.yml config/gitlab.yml
- - mkdir /apps/gitlab-satellites
- - mkdir /apps/repositories
-
- database:
- - RAILS_ENV=development force=yes bundle exec rake db:create gitlab:setup
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 3165b7379d3285e6e3c066bf29f4cc9e974ba5b0..0000000000000000000000000000000000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# Contribute to GitLab
-
-Thank you for your interest in contributing to GitLab.
-This guide details how contribute to GitLab in a way that is efficient for everyone.
-If you have read this guide and want to know how the GitLab core-team operates please see [the GitLab contributing process](PROCESS.md).
-
-## Contributor license agreement
-
-By submitting code as an individual you agree to the [individual contributor license agreement](doc/legal/individual_contributor_license_agreement.md). By submitting code as an entity you agree to the [corporate contributor license agreement](doc/legal/corporate_contributor_license_agreement.md).
-
-## Security vulnerability disclosure
-
-Please report suspected security vulnerabilities in private to support@gitlab.com, also see the [disclosure section on the GitLab.com website](http://about.gitlab.com/disclosure/). Please do NOT create publicly viewable issues for suspected security vulnerabilities.
-
-## Closing policy for issues and merge requests
-
-GitLab is a popular open source project and the capacity to deal with issues and merge requests is limited. Out of respect for our volunteers, issues and merge requests not in line with the guidelines listed in this document may be closed without notice.
-
-Please treat our volunteers with courtesy and respect, it will go a long way towards getting your issue resolved.
-
-Issues and merge requests should be in English and contain appropriate language for audiences of all ages.
-
-## Helping others
-
-Please help other GitLab users when you can.
-The channnels people will reach out on can be found on the [getting help page](https://about.gitlab.com/getting-help/).
-Sign up for the mailinglist, answer GitLab questions on StackOverflow or respond in the irc channel.
-You can also sign up on [CodeTriage](http://www.codetriage.com/gitlabhq/gitlabhq) to help with one issue every day.
-
-## Issue tracker
-
-To get support for your particular problem please use the channels as detailed in the [getting help section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#getting-help). Professional [support subscriptions](http://about.gitlab.com/subscription/) and [consulting services](http://about.gitlab.com/consultancy/) are available from [GitLab.com](http://about.gitlab.com/).
-
-The [issue tracker](https://gitlab.com/gitlab-org/gitlab-ce/issues) is only for obvious errors in the latest [stable or development release of GitLab](MAINTENANCE.md). If something is wrong but it is not a regression compared to older versions of GitLab please do not open an issue but a feature request. When submitting an issue please conform to the issue submission guidelines listed below. Not all issues will be addressed and your issue is more likely to be addressed if you submit a merge request which partially or fully addresses the issue.
-
-Issues can be filed either at [gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues) or [github.com](https://github.com/gitlabhq/gitlabhq/issues).
-
-Do not use the issue tracker for feature requests. We have a specific [feature request forum](http://feedback.gitlab.com) for this purpose. Please keep feature requests as small and simple as possible, complex ones might be edited to make them small and simple.
-
-Please send a merge request with a tested solution or a merge request with a failing test instead of opening an issue if you can. If you're unsure where to post, post to the [mailing list](https://groups.google.com/forum/#!forum/gitlabhq) or [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) first. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there.
-
-### Issue tracker guidelines
-
-**[Search the issues](https://gitlab.com/gitlab-org/gitlab-ce/issues)** for similar entries before submitting your own, there's a good chance somebody else had the same issue. Show your support with `:+1:` and/or join the discussion. Please submit issues in the following format (as the first post):
-
-1. **Summary:** Summarize your issue in one sentence (what goes wrong, what did you expect to happen)
-1. **Steps to reproduce:** How can we reproduce the issue
-1. **Expected behavior:** Describe your issue in detail
-1. **Observed behavior**
-1. **Relevant logs and/or screenshots:** Please use code blocks (\`\`\`) to format console output, logs, and code as it's very hard to read otherwise.
-1. **Output of checks**
- * Results of GitLab [Application Check](doc/install/installation.md#check-application-status) (`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`); we will only investigate if the tests are passing
- * Version of GitLab you are running; we will only investigate issues in the latest stable and development releases as per the [maintenance policy](MAINTENANCE.md)
- * Add the last commit SHA-1 of the GitLab version you used to replicate the issue (obtainable from the help page)
- * Describe your setup (use relevant parts from `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
-1. **Possible fixes**: If you can, link to the line of code that might be responsible for the problem
-
-## Merge requests
-
-We welcome merge requests with fixes and improvements to GitLab code, tests, and/or documentation. The features we would really like a merge request for are listed with the [status 'accepting merge requests' on our feature request forum](http://feedback.gitlab.com/forums/176466-general/status/796455) but other improvements are also welcome. If you want to add a new feature that is not marked it is best to first create a feedback issue (if there isn't one already) and leave a comment asking for it to be marked accepting merge requests. Please include screenshots or wireframes if the feature will also change the UI.
-
-Merge requests can be filed either at [gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests) or [github.com](https://github.com/gitlabhq/gitlabhq/pulls).
-
-If you are new to GitLab development (or web development in general), search for the label `easyfix` ([gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name=easyfix), [github](https://github.com/gitlabhq/gitlabhq/labels/easyfix)). Those are issues easy to fix, marked by the GitLab core-team. If you are unsure how to proceed but want to help, mention one of the core-team members to give you a hint.
-
-To start with GitLab download the [GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit) and see [Development section](doc/development/README.md) in the help file.
-
-### Merge request guidelines
-
-If you can, please submit a merge request with the fix or improvements including tests. If you don't know how to fix the issue but can write a test that exposes the issue we will accept that as well. In general bug fixes that include a regression test are merged quickly while new features without proper tests are least likely to receive timely feedback. The workflow to make a merge request is as follows:
-
-1. Fork the project on GitLab Cloud
-1. Create a feature branch
-1. Write [tests](https://gitlab.com/gitlab-org/gitlab-development-kit#running-the-tests) and code
-1. Add your changes to the [CHANGELOG](CHANGELOG)
-1. If you are changing the README, some documentation or other things which have no effect on the tests, add `[ci skip]` somewhere in the commit message
-1. If you have multiple commits please combine them into one commit by [squashing them](http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
-1. Push the commit to your fork
-1. Submit a merge request (MR) to the master branch
-1. The MR title should describe the change you want to make
-1. The MR description should give a motive for your change and the method you used to achieve it
-1. If the MR changes the UI it should include before and after screenshots
-1. If the MR changes CSS classes please include the list of affected pages `grep css-class ./app -R`
-1. Link relevant [issues](https://gitlab.com/gitlab-org/gitlab-ce/issues) and/or [feature requests](http://feedback.gitlab.com/) from the merge request description and leave a comment on them with a link back to the MR
-1. Be prepared to answer questions and incorporate feedback even if requests for this arrive weeks or months after your MR submission
-1. If your MR touches code that executes shell commands, make sure it adheres to the [shell command guidelines]( doc/development/shell_commands.md).
-1. Also have a look at the [shell command guidelines](doc/development/shell_commands.md) if your code reads or opens files, or handles paths to files on disk.
-
-The **official merge window** is in the beginning of the month from the 1st to the 7th day of the month. The best time to submit a MR and get feedback fast. Before this time the GitLab B.V. team is still dealing with work that is created by the monthly release such as assisting subscribers with upgrade issues, the release of Enterprise Edition and the upgrade of GitLab Cloud. After the 7th it is already getting closer to the release date of the next version. This means there is less time to fix the issues created by merging large new features.
-
-Please keep the change in a single MR **as small as possible**. If you want to contribute a large feature think very hard what the minimum viable change is. Can you split functionality? Can you only submit the backend/API code? Can you start with a very simple UI? Can you do part of the refactor? The increased reviewability of small MR's that leads to higher code quality is more important to us than having a minimal commit log. The smaller a MR is the more likely it is it will be merged (quickly), after that you can send more MR's to enhance it.
-
-For examples of feedback on merge requests please look at already [closed merge requests](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests?assignee_id=&label_name=&milestone_id=&scope=&sort=&state=closed). If you would like quick feedback on your merge request feel free to mention one of the Merge Marshalls of [the core-team](https://about.gitlab.com/core-team/). Please ensure that your merge request meets the contribution acceptance criteria.
-
-## Definition of done
-
-If you contribute to GitLab please know that changes involve more than just code.
-We have the following [definition of done](http://guide.agilealliance.org/guide/definition-of-done.html).
-Please ensure you support the feature you contribute through all of these steps.
-
-1. Description explaning the relevancy (see following item)
-1. Working and clean code that is commented where needed
-1. Unit and integration tests that pass on the CI server
-1. Documented in the /doc directory
-1. Changelog entry added
-1. Reviewed and any concerns are addressed
-1. Merged by the project lead
-1. Added to the release blog article
-1. Added to [the website](https://gitlab.com/gitlab-com/www-gitlab-com/) if relevant
-1. Community questions answered
-1. Answers to questions radiated (in docs/wiki/etc.)
-
-If you add a dependency in GitLab (such as an operating system package) please consider updating the following and note the applicability of each in your merge request:
-
-1. Note the addition in the release blog post (create one if it doesn't exist yet) https://gitlab.com/gitlab-com/www-gitlab-com/merge_requests/
-1. Upgrade guide, for example https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/7.5-to-7.6.md
-1. Upgrader https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/upgrader.md#2-run-gitlab-upgrade-tool
-1. Installation guide https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies
-1. GitLab Development Kit https://gitlab.com/gitlab-org/gitlab-development-kit
-1. Test suite https://gitlab.com/gitlab-org/gitlab-ci/blob/master/doc/examples/configure_a_runner_to_run_the_gitlab_ce_test_suite.md
-1. Omnibus package creator https://gitlab.com/gitlab-org/omnibus-gitlab
-
-## Merge request description format
-
-1. What does this MR do?
-1. Are there points in the code the reviewer needs to double check?
-1. Why was this MR needed?
-1. What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?
-1. Screenshots (if relevant)
-
-## Contribution acceptance criteria
-
-1. The change is as small as possible (see the above paragraph for details)
-1. Include proper tests and make all tests pass (unless it contains a test exposing a bug in existing code)
-1. All tests have to pass, if you suspect a failing CI build is unrelated to your contribution ask for tests to be restarted. See [the CI setup document](http://doc.gitlab.com/ce/development/ci_setup.html) on who you can ask for test restart.
-1. Initially contains a single commit (please use `git rebase -i` to squash commits)
-1. Can merge without problems (if not please merge `master`, never rebase commits pushed to the remote server)
-1. Does not break any existing functionality
-1. Fixes one specific issue or implements one specific feature (do not combine things, send separate merge requests if needed)
-1. Migrations should do only one thing (eg: either create a table, move data to a new table or remove an old table) to aid retrying on failure
-1. Keeps the GitLab code base clean and well structured
-1. Contains functionality we think other users will benefit from too
-1. Doesn't add configuration options since they complicate future changes
-1. Changes after submitting the merge request should be in separate commits (no squashing). You will be asked to squash when the review is over, before merging.
-1. It conforms to the following style guides.
- If your change touches a line that does not follow the style,
- modify the entire line to follow it. This prevents linting tools from generating warnings.
- Don't touch neighbouring lines. As an exception, automatic mass refactoring modifications
- may leave style non-compliant.
-
-## Style guides
-
-1. [Ruby](https://github.com/bbatsov/ruby-style-guide).
- Important sections include [Source Code Layout](https://github.com/bbatsov/ruby-style-guide#source-code-layout)
- and [Naming](https://github.com/bbatsov/ruby-style-guide#naming). Use:
- - multi-line method chaining style **Option B**: dot `.` on previous line
- - string literal quoting style **Option A**: single quoted by default
-1. [Rails](https://github.com/bbatsov/rails-style-guide)
-1. [Testing](https://github.com/thoughtbot/guides/tree/master/style#testing)
-1. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style#coffeescript)
-1. [Shell commands](doc/development/shell_commands.md) created by GitLab contributors to enhance security
-1. [Markdown](http://www.cirosantilli.com/markdown-styleguide)
-1. Interface text should be written subjectively instead of objectively. It should be the gitlab core team addressing a person. It should be written in present time and never use past tense (has been/was). For example instead of "prohibited this user from being saved due to the following errors:" the text should be "sorry, we could not create your account because:". Also these [excellent writing guidelines](https://github.com/NARKOZ/guides#writing).
-
-This is also the style used by linting tools such as [RuboCop](https://github.com/bbatsov/rubocop), [PullReview](https://www.pullreview.com/) and [Hound CI](https://houndci.com).
-
-## Code of conduct
-As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
-
-We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
-
-Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
-
-Instances of abusive, harassing, or otherwise unacceptable behavior can be
-reported by emailing contact@gitlab.com
-
-This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION
deleted file mode 100644
index 097a15a2af39df14efb57a9212fc648b52746783..0000000000000000000000000000000000000000
--- a/GITLAB_SHELL_VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.6.2
diff --git a/Guardfile b/Guardfile
deleted file mode 100644
index 68ac3232b099fdbedc643caee894c50ec83f922f..0000000000000000000000000000000000000000
--- a/Guardfile
+++ /dev/null
@@ -1,27 +0,0 @@
-# A sample Guardfile
-# More info at https://github.com/guard/guard#readme
-
-guard 'rspec', cmd: "spring rspec", all_on_start: false, all_after_pass: false do
- watch(%r{^spec/.+_spec\.rb$})
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
- watch(%r{^lib/api/(.+)\.rb$}) { |m| "spec/requests/api/#{m[1]}_spec.rb" }
- watch('spec/spec_helper.rb') { "spec" }
-
- # Rails example
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
- watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
- watch('config/routes.rb') { "spec/routing" }
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
-
- # Capybara request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-end
-
-guard 'spinach', command_prefix: 'spring' do
- watch(%r|^features/(.*)\.feature|)
- watch(%r|^features/steps/(.*)([^/]+)\.rb|) do |m|
- "features/#{m[1]}#{m[2]}.feature"
- end
-end
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d8cb29f36384fe739136ce15c79f41eb1ef45247..0000000000000000000000000000000000000000
--- a/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2011-2015 GitLab B.V.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/MAINTENANCE.md b/MAINTENANCE.md
deleted file mode 100644
index d3d36670693aa4c9b5b51a44e37542b077d2c9cd..0000000000000000000000000000000000000000
--- a/MAINTENANCE.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# GitLab Maintenance Policy
-
-GitLab is a fast moving and evolving project. We currently don't have the resources to support many releases concurrently. We support exactly one stable release at any given time.
-
-GitLab follows the [Semantic Versioning](http://semver.org/) for its releases: `(Major).(Minor).(Patch)` in a [pragmatic way](https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e).
-
-- **Major version**: Whenever there is something significant or any backwards incompatible changes are introduced to the public API.
-- **Minor version**: When new, backwards compatible functionality is introduced to the public API or a minor feature is introduced, or when a set of smaller features is rolled out.
-- **Patch number**: When backwards compatible bug fixes are introduced that fix incorrect behavior.
-
-The current stable release will receive security patches and bug fixes (eg. `5.0` -> `5.0.1`). Feature releases will mark the next supported stable release where the minor version is increased numerically by increments of one (eg. `5.0 -> 5.1`).
-
-We encourage everyone to run the latest stable release to ensure that you can easily upgrade to the most secure and feature rich GitLab experience. In order to make sure you can easily run the most recent stable release, we are working hard to keep the update process simple and reliable.
-
-More information about the release procedures can be found in the doc/release directory.
diff --git a/PROCESS.md b/PROCESS.md
deleted file mode 100644
index 1b6b3e7d32d053ac6124be3c1637b3f8db12c204..0000000000000000000000000000000000000000
--- a/PROCESS.md
+++ /dev/null
@@ -1,113 +0,0 @@
-# GitLab Contributing Process
-
-## Purpose of describing the contributing process
-
-Below we describe the contributing process to GitLab for two reasons. So that contributors know what to expect from maintainers (possible responses, friendly treatment, etc.). And so that maintainers know what to expect from contributors (use the latest version, ensure that the issue is addressed, friendly treatment, etc.).
-
-## Common actions
-
-### Issue team
-- Looks for issues without [workflow labels](#how-we-handle-issues) and triages issue
-- Closes invalid issues with a comment (duplicates, [feature requests](#feature-requests), [fixed in newer version](#issue-fixed-in-newer-version), [issue report for old version](#issue-report-for-old-version), not a problem in GitLab, etc.)
-- Asks for feedback from issue reporter ([invalid issue reports](#improperly-formatted-issue), [format code](#code-format), etc.)
-- Monitors all issues for feedback (but especially ones commented on since automatically watching them)
-- Closes issues with no feedback from the reporter for two weeks
-
-### Merge marshal
-
-- Responds to merge requests the issue team mentions them in and monitors for new merge requests
-- Provides feedback to the merge request submitter to improve the merge request (style, tests, etc.)
-- Mark merge requests 'ready-for-merge' when they meet the contribution guidelines
-- Mention developer(s) based on the [list of members and their specialities](https://about.gitlab.com/core-team/)
-- Closes merge requests with no feedback from the reporter for two weeks
-
-## Priorities of the issue team
-
-1. Mentioning people (critical)
-1. Workflow labels (normal)
-1. Functional labels (minor)
-1. Assigning issues (avoid if possible)
-
-## Mentioning people
-
-The most important thing is making sure valid issues receive feedback from the development team. Therefore the priority is mentioning developers that can help on those issue. Please select someone with relevant experience from [GitLab core team](https://about.gitlab.com/core-team/). If there is nobody mentioned with that expertise look in the commit history for the affected files to find someone. Avoid mentioning the lead developer, this is the person that is least likely to give a timely response. If the involvement of the lead developer is needed the other core team members will mention this person.
-
-## Workflow labels
-
-Workflow labels are purposely not very detailed since that would be hard to keep updated as you would need to re-evaluate them after every comment. We optionally use functional labels on demand when want to group related issues to get an overview (for example all issues related to RVM, to tackle them in one go) and to add details to the issue.
-
-- *Awaiting feedback*: Feedback pending from the reporter
-- *Awaiting confirmation of fix*: The issue should already be solved in **master** (generally you can avoid this workflow item and just close the issue right away)
-- *Attached MR*: There is a MR attached and the discussion should happen there
- - We need to let issues stay in sync with the MR's. We can do this with a "Closing #XXXX" or "Fixes #XXXX" comment in the MR. We can't close the issue when there is a merge request because sometimes a MR is not good and we just close the MR, then the issue must stay.
-- *Awaiting developer action/feedback*: Issue needs to be fixed or clarified by a developer
-
-## Functional labels
-
-These labels describe what development specialities are involved such as: PostgreSQL, UX, LDAP.
-
-## Assigning issues
-
-If an issue is complex and needs the attention of a specific person, assignment is a good option but assigning issues might discourage other people from contributing to that issue. We need all the contributions we can get so this should never be discouraged. Also, an assigned person might not have time for a few weeks, so others should feel free to takeover.
-
-## Label colors
-
-- Light orange `#fef2c0`: workflow labels for issue team members (awaiting feedback, awaiting confirmation of fix)
-- Bright orange `#eb6420`: workflow labels for core team members (attached MR, awaiting developer action/feedback)
-- Light blue `#82C5FF`: functional labels
-- Green labels `#009800`: issues that can generally be ignored. For example, issues given the following labels normally can be closed immediately:
- - Feature request (see copy & paste response: [Feature requests](#feature-requests))
- - Support (see copy & paste response: [Support requests and configuration questions](#support-requests-and-configuration-questions)
-
-## Be kind
-
-Be kind to people trying to contribute. Be aware that people may be a non-native English speaker, they might not understand things or they might be very sensitive as to how you word things. Use Emoji to express your feelings (heart, star, smile, etc.). Some good tips about giving feedback to merge requests is in the [Thoughtbot code review guide](https://github.com/thoughtbot/guides/tree/master/code-review).
-
-## Copy & paste responses
-
-### Improperly formatted issue
-
-Thanks for the issue report. Please reformat your issue to conform to the issue tracker guidelines found in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
-
-### Feature requests
-
-Thank you for your interest in improving GitLab. We don't use the issue tracker for feature requests. Things that are wrong but are not a regression compared to older versions of GitLab are considered feature requests and not issues. Please use the \[feature request forum\]\(http://feedback.gitlab.com/) for this purpose or create a merge request implementing this feature. Have a look at the \[contribution guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md) for more information.
-
-### Issue report for old version
-
-Thanks for the issue report but we only support issues for the latest stable version of GitLab. I'm closing this issue but if you still experience this problem in the latest stable version, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
-
-### Support requests and configuration questions
-
-Thanks for your interest in GitLab. We don't use the issue tracker for support requests and configuration questions. Please use the \[support forum\]\(https://groups.google.com/forum/#!forum/gitlabhq), \[Stack Overflow\]\(http://stackoverflow.com/questions/tagged/gitlab), the #gitlab IRC channel on Freenode or the http://about.gitlab.com paid services for this purpose. Have a look at the \[contribution guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md) for more information.
-
-### Code format
-
-Please use ``` to format console output, logs, and code as it's very hard to read otherwise.
-
-### Issue fixed in newer version
-
-Thanks for the issue report. This issue has already been fixed in newer versions of GitLab. Due to the size of this project and our limited resources we are only able to support the latest stable release as outlined in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker). In order to get this bug fix and enjoy many new features please \[upgrade\]\(https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update). If you still experience issues at that time please open a new issue following our issue tracker guidelines found in the \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
-
-### Improperly formatted merge request
-
-Thanks for your interest in improving the GitLab codebase! Please update your merge request according to the \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#pull-request-guidelines).
-
-### Inactivity close of an issue
-
-It's been at least 2 weeks (and a new release) since we heard from you. I'm closing this issue but if you still experience this problem, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
-
-### Inactivity close of a merge request
-
-This merge request has been closed because a request for more information has not been reacted to for more than 2 weeks. If you respond and conform to the merge request guidelines in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#pull-requests) we will reopen this merge request.
-
-### Accepting merge requests
-
-Is there a request on [the feature request forum](http://feedback.gitlab.com/forums/176466-general) that is similar to this? If so, can you make a comment with a link to it? Please be aware that new functionality that is not marked [accepting merge/pull requests](http://feedback.gitlab.com/forums/176466-general/status/796455) on the forum might not make it into GitLab. You might be asked to make changes and even after implementing them your feature might still be declined. If you want to reduce the chance of this happening please have a discussion in the forum first.
-
-### Only accepting merge requests with green tests
-
-We can only accept a merge request if all the tests are green. I've just
-restarted the build. When the tests are still not passing after this restart and
-you're sure that is does not have anything to do with your code changes, please
-rebase with master to see if that solves the issue.
diff --git a/Procfile b/Procfile
deleted file mode 100644
index 799b92729fa95aa90cc480ef9a01d7e6ae3b00db..0000000000000000000000000000000000000000
--- a/Procfile
+++ /dev/null
@@ -1,2 +0,0 @@
-web: bundle exec unicorn_rails -p ${PORT:="3000"} -E ${RAILS_ENV:="development"} -c ${UNICORN_CONFIG:="config/unicorn.rb"}
-worker: bundle exec sidekiq -q post_receive -q mailer -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q common -q default
diff --git a/README.md b/README.md
deleted file mode 100644
index 0563ceca4097c2ed5be75da2bf8177946a736bdd..0000000000000000000000000000000000000000
--- a/README.md
+++ /dev/null
@@ -1,104 +0,0 @@
-#  GitLab
-
-## Open source software to collaborate on code
-
-
-
-- Manage Git repositories with fine grained access controls that keep your code secure
-- Perform code reviews and enhance collaboration with merge requests
-- Each project can also have an issue tracker and a wiki
-- Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
-- Completely free and open source (MIT Expat license)
-- Powered by [Ruby on Rails](https://github.com/rails/rails)
-
-## Editions
-
-There are two editions of GitLab.
-*GitLab [Community Edition](https://about.gitlab.com/features/) (CE)* is available without any costs under an MIT license.
-
-*GitLab Enterprise Edition (EE)* includes [extra features](https://about.gitlab.com/features/#compare) that are most useful for organizations with more than 100 users.
-To get access to the EE and support please [become a subscriber](https://about.gitlab.com/pricing/).
-
-## Canonical source
-
-The source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/) and there are mirrors to make [contributing](CONTRIBUTING.md) as easy as possible.
-
-## Code status
-
-- [](https://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
-
-- [](https://semaphoreapp.com/gitlabhq/gitlabhq)
-
-- [](https://codeclimate.com/github/gitlabhq/gitlabhq)
-
-- [](https://coveralls.io/r/gitlabhq/gitlabhq?branch=master)
-
-## Website
-
-On [about.gitlab.com](https://about.gitlab.com/) you can find more information about:
-
-- [Subscriptions](https://about.gitlab.com/subscription/)
-- [Consultancy](https://about.gitlab.com/consultancy/)
-- [Community](https://about.gitlab.com/community/)
-- [Hosted GitLab.com](https://about.gitlab.com/gitlab-com/) use GitLab as a free service
-- [GitLab Enterprise Edition](https://about.gitlab.com/gitlab-ee/) with additional features aimed at larger organizations.
-- [GitLab CI](https://about.gitlab.com/gitlab-ci/) a continuous integration (CI) server that is easy to integrate with GitLab.
-
-## Requirements
-
-GitLab requires the following software:
-
-- Ubuntu/Debian/CentOS/RHEL
-- Ruby (MRI) 2.0 or 2.1
-- Git 1.7.10+
-- Redis 2.0+
-- MySQL or PostgreSQL
-
-Please see the [requirements documentation](doc/install/requirements.md) for system requirements and more information about the supported operating systems.
-
-## Installation
-
-The recommended way to install GitLab is using the provided [Omnibus packages](https://about.gitlab.com/downloads/). Compared to an installation from source, this is faster and less error prone. Just select your operating system, download the respective package (Debian or RPM) and install it using the system's package manager.
-
-There are various other options to install GitLab, please refer to the [installation page on the GitLab website](https://about.gitlab.com/installation/) for more information.
-
-You can access a new installation with the login **`root`** and password **`5iveL!fe`**, after login you are required to set a unique password.
-
-## Third-party applications
-
-There are a lot of [third-party applications integrating with GitLab](https://about.gitlab.com/applications/). These include GUI Git clients, mobile applications and API wrappers for various languages.
-
-## GitLab release cycle
-
-Since 2011 a minor or major version of GitLab is released on the 22nd of every month. Patch and security releases are published when needed. New features are detailed on the [blog](https://about.gitlab.com/blog/) and in the [changelog](CHANGELOG). For more information about the release process see the [release documentation](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/release). Features that will likely be in the next releases can be found on the [feature request forum](http://feedback.gitlab.com/forums/176466-general) with the status [started](http://feedback.gitlab.com/forums/176466-general/status/796456) and [completed](http://feedback.gitlab.com/forums/176466-general/status/796457).
-
-## Upgrading
-
-For updating the Omnibus installation please see the [update documentation](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md). For installations from source there is an [upgrader script](doc/update/upgrader.md) and there are [upgrade guides](doc/update) detailing all necessary commands to migrate to the next version.
-
-## Install a development environment
-
-To work on GitLab itself, we recommend setting up your development environment with [the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit).
-If you do not use the GitLab Development Kit you need to install and setup all the dependencies yourself, this is a lot of work and error prone.
-One small thing you also have to do when installing it yourself is to copy the example development unicorn configuration file:
-
- cp config/unicorn.rb.example.development config/unicorn.rb
-
-Instructions on how to start GitLab and how to run the tests can be found in the [development section of the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit#development).
-
-## Documentation
-
-All documentation can be found on [doc.gitlab.com/ce/](http://doc.gitlab.com/ce/).
-
-## Getting help
-
-Please see [Getting help for GitLab](https://about.gitlab.com/getting-help/) on our website for the many options to get help.
-
-## Is it any good?
-
-[Yes](https://news.ycombinator.com/item?id=3067434)
-
-## Is it awesome?
-
-Thanks for [asking this question](https://twitter.com/supersloth/status/489462789384056832) Joshua.
-[These people](https://twitter.com/gitlab/favorites) seem to like it.
diff --git a/Rakefile b/Rakefile
deleted file mode 100644
index 35b2f05cbb4566b71b34554cf184a9d0bd9d46d6..0000000000000000000000000000000000000000
--- a/Rakefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env rake
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require File.expand_path('../config/application', __FILE__)
-
-Gitlab::Application.load_tasks
diff --git a/VERSION b/VERSION
index bdc6df1ef36240b103f4247c6e3e1b9b493faf62..5306ee61e007b66d7477dcac875a1b7376a35626 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.10.0.rc4
\ No newline at end of file
+7.10.0.rc5
\ No newline at end of file
diff --git a/app/assets/images/authbuttons/bitbucket_64.png b/app/assets/images/authbuttons/bitbucket_64.png
deleted file mode 100644
index 4b90a57bc7de93163275f99ea2971e2740af98af..0000000000000000000000000000000000000000
Binary files a/app/assets/images/authbuttons/bitbucket_64.png and /dev/null differ
diff --git a/app/assets/images/authbuttons/github_64.png b/app/assets/images/authbuttons/github_64.png
deleted file mode 100644
index dc7c03d10052a596f062207ae0fd8e9cf384b2aa..0000000000000000000000000000000000000000
Binary files a/app/assets/images/authbuttons/github_64.png and /dev/null differ
diff --git a/app/assets/images/authbuttons/gitlab_64.png b/app/assets/images/authbuttons/gitlab_64.png
deleted file mode 100644
index 31281a194441d4e23bb691de89110c6097021ac9..0000000000000000000000000000000000000000
Binary files a/app/assets/images/authbuttons/gitlab_64.png and /dev/null differ
diff --git a/app/assets/images/authbuttons/google_64.png b/app/assets/images/authbuttons/google_64.png
deleted file mode 100644
index 94a0e089c6efe07dcb50af341d51c2d13b689639..0000000000000000000000000000000000000000
Binary files a/app/assets/images/authbuttons/google_64.png and /dev/null differ
diff --git a/app/assets/images/authbuttons/twitter_64.png b/app/assets/images/authbuttons/twitter_64.png
deleted file mode 100644
index 5c9f14cb0771005efaa2ed050560298aa03131b3..0000000000000000000000000000000000000000
Binary files a/app/assets/images/authbuttons/twitter_64.png and /dev/null differ
diff --git a/app/assets/images/bg-header.png b/app/assets/images/bg-header.png
deleted file mode 100644
index 639271c6fafc58a2007f22478ba2d52e57c2a2ee..0000000000000000000000000000000000000000
Binary files a/app/assets/images/bg-header.png and /dev/null differ
diff --git a/app/assets/images/bg_fallback.png b/app/assets/images/bg_fallback.png
deleted file mode 100644
index e5fe659ba63db076784a420b69bf188d898ef52f..0000000000000000000000000000000000000000
Binary files a/app/assets/images/bg_fallback.png and /dev/null differ
diff --git a/app/assets/images/brand_logo.png b/app/assets/images/brand_logo.png
deleted file mode 100644
index 9c564bb61411bf4f0dec3e21aa86848ac70cbcb8..0000000000000000000000000000000000000000
Binary files a/app/assets/images/brand_logo.png and /dev/null differ
diff --git a/app/assets/images/chosen-sprite.png b/app/assets/images/chosen-sprite.png
deleted file mode 100644
index 3d936b07d443fb420a71cac72750537bb54ad2cd..0000000000000000000000000000000000000000
Binary files a/app/assets/images/chosen-sprite.png and /dev/null differ
diff --git a/app/assets/images/dark-scheme-preview.png b/app/assets/images/dark-scheme-preview.png
deleted file mode 100644
index 2ef58e52549c6315b66a6dc960e4603de1c00d4b..0000000000000000000000000000000000000000
Binary files a/app/assets/images/dark-scheme-preview.png and /dev/null differ
diff --git a/app/assets/images/diff_note_add.png b/app/assets/images/diff_note_add.png
deleted file mode 100644
index 0084422e3303593e2f067c7de013413f393b0f88..0000000000000000000000000000000000000000
Binary files a/app/assets/images/diff_note_add.png and /dev/null differ
diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico
deleted file mode 100644
index bfb74960c480e6cb14f1d38437303af6b375ccaf..0000000000000000000000000000000000000000
Binary files a/app/assets/images/favicon.ico and /dev/null differ
diff --git a/app/assets/images/gitorious-logo-black.png b/app/assets/images/gitorious-logo-black.png
deleted file mode 100644
index 78f17a9af79dc2395acd9bcc2a391589dd6b6ed8..0000000000000000000000000000000000000000
Binary files a/app/assets/images/gitorious-logo-black.png and /dev/null differ
diff --git a/app/assets/images/gitorious-logo-blue.png b/app/assets/images/gitorious-logo-blue.png
deleted file mode 100644
index 4962cffba3153927ddd8cd5ff295fe4ca142bfa8..0000000000000000000000000000000000000000
Binary files a/app/assets/images/gitorious-logo-blue.png and /dev/null differ
diff --git a/app/assets/images/icon-link.png b/app/assets/images/icon-link.png
deleted file mode 100644
index 60021d5ac47686cce70570d22bad6670082caf56..0000000000000000000000000000000000000000
Binary files a/app/assets/images/icon-link.png and /dev/null differ
diff --git a/app/assets/images/icon-search.png b/app/assets/images/icon-search.png
deleted file mode 100644
index 3c1c146541d456a042db5768154a307b9b535e9d..0000000000000000000000000000000000000000
Binary files a/app/assets/images/icon-search.png and /dev/null differ
diff --git a/app/assets/images/icon_sprite.png b/app/assets/images/icon_sprite.png
deleted file mode 100644
index 2e7a5023398e7aa1d2794755af4f90d59b431919..0000000000000000000000000000000000000000
Binary files a/app/assets/images/icon_sprite.png and /dev/null differ
diff --git a/app/assets/images/images.png b/app/assets/images/images.png
deleted file mode 100644
index ad146246caf907144b468a121ef9524ba8ec3c74..0000000000000000000000000000000000000000
Binary files a/app/assets/images/images.png and /dev/null differ
diff --git a/app/assets/images/logo-white.png b/app/assets/images/logo-white.png
deleted file mode 100644
index 917bcfcb7e750f8426dd79912ca525dc65183a56..0000000000000000000000000000000000000000
Binary files a/app/assets/images/logo-white.png and /dev/null differ
diff --git a/app/assets/images/monokai-scheme-preview.png b/app/assets/images/monokai-scheme-preview.png
deleted file mode 100644
index fbb339c6a9170de79c5fee8fc2a5abd6a785f4e7..0000000000000000000000000000000000000000
Binary files a/app/assets/images/monokai-scheme-preview.png and /dev/null differ
diff --git a/app/assets/images/move.png b/app/assets/images/move.png
deleted file mode 100644
index 6a0567f8f2534837e7280dd41e4bf4b98725a3bf..0000000000000000000000000000000000000000
Binary files a/app/assets/images/move.png and /dev/null differ
diff --git a/app/assets/images/no_avatar.png b/app/assets/images/no_avatar.png
deleted file mode 100644
index 8287acbce13e32d0823c8f5fd449099c1c61d6cd..0000000000000000000000000000000000000000
Binary files a/app/assets/images/no_avatar.png and /dev/null differ
diff --git a/app/assets/images/no_group_avatar.png b/app/assets/images/no_group_avatar.png
deleted file mode 100644
index bfb31bb2184f6895c55c3027ddf9e357170bc338..0000000000000000000000000000000000000000
Binary files a/app/assets/images/no_group_avatar.png and /dev/null differ
diff --git a/app/assets/images/onion_skin_sprites.gif b/app/assets/images/onion_skin_sprites.gif
deleted file mode 100644
index 337aa1bfb632ff492b0a24ffe652ca5ab46f6ffa..0000000000000000000000000000000000000000
Binary files a/app/assets/images/onion_skin_sprites.gif and /dev/null differ
diff --git a/app/assets/images/progress_bar.gif b/app/assets/images/progress_bar.gif
deleted file mode 100644
index c3d43fa40b2fd90186d22f8a82bdc4673d8ab904..0000000000000000000000000000000000000000
Binary files a/app/assets/images/progress_bar.gif and /dev/null differ
diff --git a/app/assets/images/slider_handles.png b/app/assets/images/slider_handles.png
deleted file mode 100644
index 884378ec96a20c1cb2a419e1dc1aa68ab9d85c15..0000000000000000000000000000000000000000
Binary files a/app/assets/images/slider_handles.png and /dev/null differ
diff --git a/app/assets/images/solarized-dark-scheme-preview.png b/app/assets/images/solarized-dark-scheme-preview.png
deleted file mode 100644
index 7ed7336896b1daa3d06b3f304931bc2006a3b145..0000000000000000000000000000000000000000
Binary files a/app/assets/images/solarized-dark-scheme-preview.png and /dev/null differ
diff --git a/app/assets/images/solarized-light-scheme-preview.png b/app/assets/images/solarized-light-scheme-preview.png
deleted file mode 100644
index c50db75449b974294a612f3215a673c7c2217f80..0000000000000000000000000000000000000000
Binary files a/app/assets/images/solarized-light-scheme-preview.png and /dev/null differ
diff --git a/app/assets/images/swipemode_sprites.gif b/app/assets/images/swipemode_sprites.gif
deleted file mode 100644
index b010b4e4482760d5e144d93c2b6c76fa4f981438..0000000000000000000000000000000000000000
Binary files a/app/assets/images/swipemode_sprites.gif and /dev/null differ
diff --git a/app/assets/images/switch_icon.png b/app/assets/images/switch_icon.png
deleted file mode 100644
index c6b6c8d9521f64b00990ca5352c8ce269e9a3e4a..0000000000000000000000000000000000000000
Binary files a/app/assets/images/switch_icon.png and /dev/null differ
diff --git a/app/assets/images/trans_bg.gif b/app/assets/images/trans_bg.gif
deleted file mode 100644
index 1a1c9c15ec71a58db869578399068cf313c51599..0000000000000000000000000000000000000000
Binary files a/app/assets/images/trans_bg.gif and /dev/null differ
diff --git a/app/assets/images/white-scheme-preview.png b/app/assets/images/white-scheme-preview.png
deleted file mode 100644
index fc4c40b9227cced4692d9c3f0b3e09d62894fe3e..0000000000000000000000000000000000000000
Binary files a/app/assets/images/white-scheme-preview.png and /dev/null differ
diff --git a/app/assets/javascripts/activities.js.coffee b/app/assets/javascripts/activities.js.coffee
deleted file mode 100644
index 777c62dc1b7773254cab7bfbe588166832a944dc..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/activities.js.coffee
+++ /dev/null
@@ -1,29 +0,0 @@
-class @Activities
- constructor: ->
- Pager.init 20, true
- $(".event_filter_link").bind "click", (event) =>
- event.preventDefault()
- @toggleFilter($(event.currentTarget))
- @reloadActivities()
-
- reloadActivities: ->
- $(".content_list").html ''
- Pager.init 20, true
-
-
- toggleFilter: (sender) ->
- sender.parent().toggleClass "active"
- event_filters = $.cookie("event_filter")
- filter = sender.attr("id").split("_")[0]
- if event_filters
- event_filters = event_filters.split(",")
- else
- event_filters = new Array()
-
- index = event_filters.indexOf(filter)
- if index is -1
- event_filters.push filter
- else
- event_filters.splice index, 1
-
- $.cookie "event_filter", event_filters.join(","), { path: '/' }
diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee
deleted file mode 100644
index bcb2e6df7c01450cc9bccd1a530f8811d2ae6976..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/admin.js.coffee
+++ /dev/null
@@ -1,53 +0,0 @@
-class @Admin
- constructor: ->
- $('input#user_force_random_password').on 'change', (elem) ->
- elems = $('#user_password, #user_password_confirmation')
-
- if $(@).attr 'checked'
- elems.val('').attr 'disabled', true
- else
- elems.removeAttr 'disabled'
-
- $('body').on 'click', '.js-toggle-colors-link', (e) ->
- e.preventDefault()
- $('.js-toggle-colors-link').hide()
- $('.js-toggle-colors-container').show()
-
- $('input#broadcast_message_color').on 'input', ->
- previewColor = $('input#broadcast_message_color').val()
- $('div.broadcast-message-preview').css('background-color', previewColor)
-
- $('input#broadcast_message_font').on 'input', ->
- previewColor = $('input#broadcast_message_font').val()
- $('div.broadcast-message-preview').css('color', previewColor)
-
- $('textarea#broadcast_message_message').on 'input', ->
- previewMessage = $('textarea#broadcast_message_message').val()
- $('div.broadcast-message-preview span').text(previewMessage)
-
- $('.log-tabs a').click (e) ->
- e.preventDefault()
- $(this).tab('show')
-
- $('.log-bottom').click (e) ->
- e.preventDefault()
- visible_log = $(".file-content:visible")
- visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
-
- modal = $('.change-owner-holder')
-
- $('.change-owner-link').bind "click", (e) ->
- e.preventDefault()
- $(this).hide()
- modal.show()
-
- $('.change-owner-cancel-link').bind "click", (e) ->
- e.preventDefault()
- modal.hide()
- $('.change-owner-link').show()
-
- $('li.project_member').bind 'ajax:success', ->
- Turbolinks.visit(location.href)
-
- $('li.group_member').bind 'ajax:success', ->
- Turbolinks.visit(location.href)
diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee
deleted file mode 100644
index 9e5d594c861d6867308d9c47b571795fe5f51efd..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/api.js.coffee
+++ /dev/null
@@ -1,49 +0,0 @@
-@Api =
- groups_path: "/api/:version/groups.json"
- group_path: "/api/:version/groups/:id.json"
- namespaces_path: "/api/:version/namespaces.json"
-
- group: (group_id, callback) ->
- url = Api.buildUrl(Api.group_path)
- url = url.replace(':id', group_id)
-
- $.ajax(
- url: url
- data:
- private_token: gon.api_token
- dataType: "json"
- ).done (group) ->
- callback(group)
-
- # Return groups list. Filtered by query
- # Only active groups retrieved
- groups: (query, skip_ldap, callback) ->
- url = Api.buildUrl(Api.groups_path)
-
- $.ajax(
- url: url
- data:
- private_token: gon.api_token
- search: query
- per_page: 20
- dataType: "json"
- ).done (groups) ->
- callback(groups)
-
- # Return namespaces list. Filtered by query
- namespaces: (query, callback) ->
- url = Api.buildUrl(Api.namespaces_path)
-
- $.ajax(
- url: url
- data:
- private_token: gon.api_token
- search: query
- per_page: 20
- dataType: "json"
- ).done (namespaces) ->
- callback(namespaces)
-
- buildUrl: (url) ->
- url = gon.relative_url_root + url if gon.relative_url_root?
- return url.replace(':version', gon.api_version)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
deleted file mode 100644
index fda142293bc9b42daab5866d9c52f38339a8409e..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/application.js.coffee
+++ /dev/null
@@ -1,194 +0,0 @@
-# This is a manifest file that'll be compiled into including all the files listed below.
-# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
-# be included in the compiled file accessible from http://example.com/assets/application.js
-# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-# the compiled file.
-#
-#= require jquery
-#= require jquery.ui.all
-#= require jquery_ujs
-#= require jquery.cookie
-#= require jquery.endless-scroll
-#= require jquery.highlight
-#= require jquery.history
-#= require jquery.waitforimages
-#= require jquery.atwho
-#= require jquery.scrollTo
-#= require jquery.blockUI
-#= require jquery.turbolinks
-#= require jquery.sticky-kit.min
-#= require turbolinks
-#= require autosave
-#= require bootstrap
-#= require select2
-#= require raphael
-#= require g.raphael-min
-#= require g.bar-min
-#= require chart-lib.min
-#= require branch-graph
-#= require ace/ace
-#= require ace/ext-searchbox
-#= require d3
-#= require underscore
-#= require nprogress
-#= require nprogress-turbolinks
-#= require dropzone
-#= require mousetrap
-#= require mousetrap/pause
-#= require shortcuts
-#= require shortcuts_navigation
-#= require shortcuts_dashboard_navigation
-#= require shortcuts_issueable
-#= require shortcuts_network
-#= require cal-heatmap
-#= require_tree .
-
-window.slugify = (text) ->
- text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase()
-
-window.ajaxGet = (url) ->
- $.ajax({type: "GET", url: url, dataType: "script"})
-
-window.showAndHide = (selector) ->
-
-window.split = (val) ->
- return val.split( /,\s*/ )
-
-window.extractLast = (term) ->
- return split( term ).pop()
-
-window.rstrip = (val) ->
- return if val then val.replace(/\s+$/, '') else val
-
-# Disable button if text field is empty
-window.disableButtonIfEmptyField = (field_selector, button_selector) ->
- field = $(field_selector)
- closest_submit = field.closest('form').find(button_selector)
-
- closest_submit.disable() if rstrip(field.val()) is ""
-
- field.on 'input', ->
- if rstrip($(@).val()) is ""
- closest_submit.disable()
- else
- closest_submit.enable()
-
-# Disable button if any input field with given selector is empty
-window.disableButtonIfAnyEmptyField = (form, form_selector, button_selector) ->
- closest_submit = form.find(button_selector)
- updateButtons = ->
- filled = true
- form.find('input').filter(form_selector).each ->
- filled = rstrip($(this).val()) != "" || !$(this).attr('required')
-
- if filled
- closest_submit.enable()
- else
- closest_submit.disable()
-
- updateButtons()
- form.keyup(updateButtons)
-
-window.sanitize = (str) ->
- return str.replace(/<(?:.|\n)*?>/gm, '')
-
-window.linkify = (str) ->
- exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig
- return str.replace(exp,"$1")
-
-window.simpleFormat = (str) ->
- linkify(sanitize(str).replace(/\n/g, '
'))
-
-window.unbindEvents = ->
- $(document).unbind('scroll')
- $(document).off('scroll')
-
-window.shiftWindow = ->
- scrollBy 0, -50
-
-document.addEventListener("page:fetch", unbindEvents)
-
-# Scroll the window to avoid the topnav bar
-# https://github.com/twitter/bootstrap/issues/1768
-if location.hash
- setTimeout shiftWindow, 1
-window.addEventListener "hashchange", shiftWindow
-
-$ ->
- # Click a .one_click_select field, select the contents
- $(".one_click_select").on 'click', -> $(@).select()
-
- $('.remove-row').bind 'ajax:success', ->
- $(this).closest('li').fadeOut()
-
- # Initialize select2 selects
- $('select.select2').select2(width: 'resolve', dropdownAutoWidth: true)
-
- # Close select2 on escape
- $('.js-select2').bind 'select2-close', ->
- setTimeout ( ->
- $('.select2-container-active').removeClass('select2-container-active')
- $(':focus').blur()
- ), 1
-
- # Initialize tooltips
- $('.has_tooltip').tooltip()
-
- # Bottom tooltip
- $('.has_bottom_tooltip').tooltip(placement: 'bottom')
-
- # Form submitter
- $('.trigger-submit').on 'change', ->
- $(@).parents('form').submit()
-
- $("abbr.timeago").timeago()
- $('.js-timeago').timeago()
-
- # Flash
- if (flash = $(".flash-container")).length > 0
- flash.click -> $(@).fadeOut()
- flash.show()
-
- # Disable form buttons while a form is submitting
- $('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
- buttons = $('[type="submit"]', @)
-
- switch e.type
- when 'ajax:beforeSend', 'submit'
- buttons.disable()
- else
- buttons.enable()
-
- # Show/Hide the profile menu when hovering the account box
- $('.account-box').hover -> $(@).toggleClass('hover')
-
- # Commit show suppressed diff
- $(".diff-content").on "click", ".supp_diff_link", ->
- $(@).next('table').show()
- $(@).remove()
-
- # Show/hide comments on diff
- $("body").on "click", ".js-toggle-diff-comments", (e) ->
- $(@).toggleClass('active')
- $(@).closest(".diff-file").find(".notes_holder").toggle()
- e.preventDefault()
-
- $(document).on "click", '.js-confirm-danger', (e) ->
- e.preventDefault()
- btn = $(e.target)
- text = btn.data("confirm-danger-message")
- form = btn.closest("form")
- new ConfirmDangerModal(form, text)
-
- new Aside()
-
-(($) ->
- # Disable an element and add the 'disabled' Bootstrap class
- $.fn.extend disable: ->
- $(@).attr('disabled', 'disabled').addClass('disabled')
-
- # Enable an element and remove the 'disabled' Bootstrap class
- $.fn.extend enable: ->
- $(@).removeAttr('disabled').removeClass('disabled')
-
-)(jQuery)
diff --git a/app/assets/javascripts/aside.js.coffee b/app/assets/javascripts/aside.js.coffee
deleted file mode 100644
index 854731019443e3ea1d49e73a3fa5a12e5fc00185..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/aside.js.coffee
+++ /dev/null
@@ -1,17 +0,0 @@
-class @Aside
- constructor: ->
- $(document).off "click", "a.show-aside"
- $(document).on "click", 'a.show-aside', (e) ->
- e.preventDefault()
- btn = $(e.currentTarget)
- icon = btn.find('i')
- console.log('1')
-
- if icon.hasClass('fa-angle-left')
- btn.parent().find('section').hide()
- btn.parent().find('aside').fadeIn()
- icon.removeClass('fa-angle-left').addClass('fa-angle-right')
- else
- btn.parent().find('aside').hide()
- btn.parent().find('section').fadeIn()
- icon.removeClass('fa-angle-right').addClass('fa-angle-left')
diff --git a/app/assets/javascripts/autosave.js.coffee b/app/assets/javascripts/autosave.js.coffee
deleted file mode 100644
index 5d3fe81da74aefe071aaf29f905d29f39a898859..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/autosave.js.coffee
+++ /dev/null
@@ -1,39 +0,0 @@
-class @Autosave
- constructor: (field, key) ->
- @field = field
-
- key = key.join("/") if key.join?
- @key = "autosave/#{key}"
-
- @field.data "autosave", this
-
- @restore()
-
- @field.on "input", => @save()
-
- restore: ->
- return unless window.localStorage?
-
- try
- text = window.localStorage.getItem @key
- catch
- return
-
- @field.val text if text?.length > 0
- @field.trigger "input"
-
- save: ->
- return unless window.localStorage?
-
- text = @field.val()
- if text?.length > 0
- try
- window.localStorage.setItem @key, text
- else
- @reset()
-
- reset: ->
- return unless window.localStorage?
-
- try
- window.localStorage.removeItem @key
diff --git a/app/assets/javascripts/behaviors/details_behavior.coffee b/app/assets/javascripts/behaviors/details_behavior.coffee
deleted file mode 100644
index decab3e1bed29bc2c9f26804be2308f52298da34..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/behaviors/details_behavior.coffee
+++ /dev/null
@@ -1,15 +0,0 @@
-$ ->
- $("body").on "click", ".js-details-target", ->
- container = $(@).closest(".js-details-container")
- container.toggleClass("open")
-
- # Show details content. Hides link after click.
- #
- # %div
- # %a.js-details-expand
- # %div.js-details-content
- #
- $("body").on "click", ".js-details-expand", (e) ->
- $(@).next('.js-details-content').removeClass("hide")
- $(@).hide()
- e.preventDefault()
diff --git a/app/assets/javascripts/behaviors/taskable.js.coffee b/app/assets/javascripts/behaviors/taskable.js.coffee
deleted file mode 100644
index ddce71c18863eca382fe2d2322d5e6f35206a819..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/behaviors/taskable.js.coffee
+++ /dev/null
@@ -1,21 +0,0 @@
-window.updateTaskState = (taskableType) ->
- objType = taskableType.data
- isChecked = $(this).prop("checked")
- if $(this).is(":checked")
- stateEvent = "task_check"
- else
- stateEvent = "task_uncheck"
-
- taskableUrl = $("form.edit-" + objType).first().attr("action")
- taskableNum = taskableUrl.match(/\d+$/)
- taskNum = 0
- $("li.task-list-item input:checkbox").each( (index, e) =>
- if e == this
- taskNum = index + 1
- )
-
- $.ajax
- type: "PATCH"
- url: taskableUrl
- data: objType + "[state_event]=" + stateEvent +
- "&" + objType + "[task_num]=" + taskNum
diff --git a/app/assets/javascripts/behaviors/toggler_behavior.coffee b/app/assets/javascripts/behaviors/toggler_behavior.coffee
deleted file mode 100644
index 177b6918270dcc1a58851fc46f10dcb5aae2f06e..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/behaviors/toggler_behavior.coffee
+++ /dev/null
@@ -1,14 +0,0 @@
-$ ->
- # Toggle button. Show/hide content inside parent container.
- # Button does not change visibility. If button has icon - it changes chevron style.
- #
- # %div.js-toggle-container
- # %a.js-toggle-button
- # %div.js-toggle-content
- #
- $("body").on "click", ".js-toggle-button", (e) ->
- $(@).find('i').
- toggleClass('fa fa-chevron-down').
- toggleClass('fa fa-chevron-up')
- $(@).closest(".js-toggle-container").find(".js-toggle-content").toggle()
- e.preventDefault()
diff --git a/app/assets/javascripts/blob/blob.js.coffee b/app/assets/javascripts/blob/blob.js.coffee
deleted file mode 100644
index 37a175fdbc725fdaceb0187ab73547063c0821bb..0000000000000000000000000000000000000000
--- a/app/assets/javascripts/blob/blob.js.coffee
+++ /dev/null
@@ -1,73 +0,0 @@
-class @BlobView
- constructor: ->
- # handle multi-line select
- handleMultiSelect = (e) ->
- [ first_line, last_line ] = parseSelectedLines()
- [ line_number ] = parseSelectedLines($(this).attr("id"))
- hash = "L#{line_number}"
-
- if e.shiftKey and not isNaN(first_line) and not isNaN(line_number)
- if line_number < first_line
- last_line = first_line
- first_line = line_number
- else
- last_line = line_number
-
- hash = if first_line == last_line then "L#{first_line}" else "L#{first_line}-#{last_line}"
-
- setHash(hash)
- e.preventDefault()
-
- # See if there are lines selected
- # "#L12" and "#L34-56" supported
- highlightBlobLines = (e) ->
- [ first_line, last_line ] = parseSelectedLines()
-
- unless isNaN first_line
- $("#tree-content-holder .highlight .line").removeClass("hll")
- $("#LC#{line}").addClass("hll") for line in [first_line..last_line]
- $.scrollTo("#L#{first_line}", offset: -50) unless e?
-
- # parse selected lines from hash
- # always return first and last line (initialized to NaN)
- parseSelectedLines = (str) ->
- first_line = NaN
- last_line = NaN
- hash = str || window.location.hash
-
- if hash isnt ""
- matches = hash.match(/\#?L(\d+)(\-(\d+))?/)
- first_line = parseInt(matches?[1])
- last_line = parseInt(matches?[3])
- last_line = first_line if isNaN(last_line)
-
- [ first_line, last_line ]
-
- setHash = (hash) ->
- hash = hash.replace(/^\#/, "")
- nodes = $("#" + hash)
- # if any nodes are using this id, they must be temporarily changed
- # also, add a temporary div at the top of the screen to prevent scrolling
- if nodes.length > 0
- scroll_top = $(document).scrollTop()
- nodes.attr("id", "")
- tmp = $("
)?\[(? Welcome <%= @resource.name %>! You can confirm your email (<%= @resource.unconfirmed_email %>) through the link below: You can confirm your account through the link below: <%= link_to 'Confirm your account', confirmation_url(@resource, confirmation_token: @token) %> Hello <%= @resource.email %>! Someone has requested a link to change your password, and you can do this through the link below. <%= link_to 'Change your password', edit_password_url(@resource, reset_password_token: @token) %> If you didn't request this, please ignore this email. Your password won't change until you access the link above and create a new one. Hello <%= @resource.email %>! Your account has been locked due to an excessive amount of unsuccessful sign in attempts. Click the link below to unlock your account: <%= link_to 'Unlock your account', unlock_url(@resource, unlock_token: @token) %> Unhappy? <%= link_to "Cancel your account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>. This namespace already been taken! Please choose another one Access denied! Please verify you can add deploy keys to this repository. I like it :+1: You may have mistyped the address or the page may have moved. Maybe you tried to change something you didn't have access to. Please contact your GitLab administrator if this problem persists. Please contact your GitLab administrator if this problem persists. I guess/
- end
-
- it 'should have XHTML summaries in notes' do
- expect(body).to match /Bug confirmed
- #{commit[:message].lines.first} (#{commit[:id][0..5]})"
- end
-
- if push[:commits].count > MAX_COMMITS
- message << "
... #{push[:commits].count - MAX_COMMITS} more commits"
- end
- end
-
- message
- end
-
- def format_body(body)
- if body
- body = body.truncate(200, separator: ' ', omission: '...')
- end
-
- "#{body}"
- end
-
- def create_issue_message(data)
- user_name = data[:user][:name]
-
- obj_attr = data[:object_attributes]
- obj_attr = HashWithIndifferentAccess.new(obj_attr)
- title = obj_attr[:title]
- state = obj_attr[:state]
- issue_iid = obj_attr[:iid]
- issue_url = obj_attr[:url]
- description = obj_attr[:description]
-
- issue_link = "issue ##{issue_iid}"
- message = "#{user_name} #{state} #{issue_link} in #{project_link}: #{title}"
-
- if description
- description = format_body(description)
- message << description
- end
-
- message
- end
-
- def create_merge_request_message(data)
- user_name = data[:user][:name]
-
- obj_attr = data[:object_attributes]
- obj_attr = HashWithIndifferentAccess.new(obj_attr)
- merge_request_id = obj_attr[:iid]
- source_branch = obj_attr[:source_branch]
- target_branch = obj_attr[:target_branch]
- state = obj_attr[:state]
- description = obj_attr[:description]
- title = obj_attr[:title]
-
- merge_request_url = "#{project_url}/merge_requests/#{merge_request_id}"
- merge_request_link = "merge request ##{merge_request_id}"
- message = "#{user_name} #{state} #{merge_request_link} in " \
- "#{project_link}: #{title}"
-
- if description
- description = format_body(description)
- message << description
- end
-
- message
- end
-
- def format_title(title)
- "" + title.lines.first.chomp + ""
- end
-
- def create_note_message(data)
- data = HashWithIndifferentAccess.new(data)
- user_name = data[:user][:name]
-
- repo_attr = HashWithIndifferentAccess.new(data[:repository])
-
- obj_attr = HashWithIndifferentAccess.new(data[:object_attributes])
- note = obj_attr[:note]
- note_url = obj_attr[:url]
- noteable_type = obj_attr[:noteable_type]
-
- case noteable_type
- when "Commit"
- commit_attr = HashWithIndifferentAccess.new(data[:commit])
- subject_desc = commit_attr[:id]
- subject_desc = Commit.truncate_sha(subject_desc)
- subject_type = "commit"
- title = format_title(commit_attr[:message])
- when "Issue"
- subj_attr = HashWithIndifferentAccess.new(data[:issue])
- subject_id = subj_attr[:iid]
- subject_desc = "##{subject_id}"
- subject_type = "issue"
- title = format_title(subj_attr[:title])
- when "MergeRequest"
- subj_attr = HashWithIndifferentAccess.new(data[:merge_request])
- subject_id = subj_attr[:iid]
- subject_desc = "##{subject_id}"
- subject_type = "merge request"
- title = format_title(subj_attr[:title])
- when "Snippet"
- subj_attr = HashWithIndifferentAccess.new(data[:snippet])
- subject_id = subj_attr[:id]
- subject_desc = "##{subject_id}"
- subject_type = "snippet"
- title = format_title(subj_attr[:title])
- end
-
- subject_html = "#{subject_type} #{subject_desc}"
- message = "#{user_name} commented on #{subject_html} in #{project_link}: "
- message << title
-
- if note
- note = format_body(note)
- message << note
- end
-
- message
- end
-
- def project_name
- project.name_with_namespace.gsub(/\s/, '')
- end
-
- def project_url
- project.web_url
- end
-
- def project_link
- "#{project_name}"
- end
-
- def is_update?(data)
- data[:object_attributes][:action] == 'update'
- end
-end
diff --git a/app/models/project_services/irker_service.rb b/app/models/project_services/irker_service.rb
deleted file mode 100644
index e9e1e276e7d690aaf3c0dcc71bbc8c83e10eeadb..0000000000000000000000000000000000000000
--- a/app/models/project_services/irker_service.rb
+++ /dev/null
@@ -1,163 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'uri'
-
-class IrkerService < Service
- prop_accessor :colorize_messages, :recipients, :channels
- validates :recipients, presence: true, if: :activated?
- validate :check_recipients_count, if: :activated?
-
- before_validation :get_channels
- after_initialize :initialize_settings
-
- # Writer for RSpec tests
- attr_writer :settings
-
- def initialize_settings
- # See the documentation (doc/project_services/irker.md) for possible values
- # here
- @settings ||= {
- server_ip: 'localhost',
- server_port: 6659,
- max_channels: 3,
- default_irc_uri: nil
- }
- end
-
- def title
- 'Irker (IRC gateway)'
- end
-
- def description
- 'Send IRC messages, on update, to a list of recipients through an Irker '\
- 'gateway.'
- end
-
- def help
- msg = 'Recipients have to be specified with a full URI: '\
- 'irc[s]://irc.network.net[:port]/#channel. Special cases: if you want '\
- 'the channel to be a nickname instead, append ",isnick" to the channel '\
- 'name; if the channel is protected by a secret password, append '\
- '"?key=secretpassword" to the URI.'
-
- unless @settings[:default_irc].nil?
- msg += ' Note that a default IRC URI is provided by this service\'s '\
- "administrator: #{default_irc}. You can thus just give a channel name."
- end
- msg
- end
-
- def to_param
- 'irker'
- end
-
- def supported_events
- %w(push)
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
-
- IrkerWorker.perform_async(project_id, channels,
- colorize_messages, data, @settings)
- end
-
- def fields
- [
- { type: 'textarea', name: 'recipients',
- placeholder: 'Recipients/channels separated by whitespaces' },
- { type: 'checkbox', name: 'colorize_messages' },
- ]
- end
-
- private
-
- def check_recipients_count
- return true if recipients.nil? || recipients.empty?
-
- if recipients.split(/\s+/).count > max_chans
- errors.add(:recipients, "are limited to #{max_chans}")
- end
- end
-
- def max_chans
- @settings[:max_channels]
- end
-
- def get_channels
- return true unless :activated?
- return true if recipients.nil? || recipients.empty?
-
- map_recipients
-
- errors.add(:recipients, 'are all invalid') if channels.empty?
- true
- end
-
- def map_recipients
- self.channels = recipients.split(/\s+/).map do |recipient|
- format_channel default_irc_uri, recipient
- end
- channels.reject! &:nil?
- end
-
- def default_irc_uri
- default_irc = @settings[:default_irc_uri]
- if !(default_irc.nil? || default_irc[-1] == '/')
- default_irc += '/'
- end
- default_irc
- end
-
- def format_channel(default_irc, recipient)
- cnt = 0
- url = nil
-
- # Try to parse the chan as a full URI
- begin
- uri = URI.parse(recipient)
- raise URI::InvalidURIError if uri.scheme.nil? && cnt == 0
- rescue URI::InvalidURIError
- unless default_irc.nil?
- cnt += 1
- recipient = "#{default_irc}#{recipient}"
- retry if cnt == 1
- end
- else
- url = consider_uri uri
- end
- url
- end
-
- def consider_uri(uri)
- # Authorize both irc://domain.com/#chan and irc://domain.com/chan
- if uri.is_a?(URI) && uri.scheme[/^ircs?\z/] && !uri.path.nil?
- # Do not authorize irc://domain.com/
- if uri.fragment.nil? && uri.path.length > 1
- uri.to_s
- else
- # Authorize irc://domain.com/smthg#chan
- # The irker daemon will deal with it by concatenating smthg and
- # chan, thus sending messages on #smthgchan
- uri.to_s
- end
- end
- end
-end
diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb
deleted file mode 100644
index c8ab9d63b7499ce78a97ecdb7d39e28623a32ad6..0000000000000000000000000000000000000000
--- a/app/models/project_services/issue_tracker_service.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class IssueTrackerService < Service
-
- validates :project_url, :issues_url, :new_issue_url, presence: true, if: :activated?
-
- def category
- :issue_tracker
- end
-
- def default?
- false
- end
-
- def issue_url(iid)
- self.issues_url.gsub(':id', iid.to_s)
- end
-
- def project_path
- project_url
- end
-
- def new_issue_path
- new_issue_url
- end
-
- def issue_path(iid)
- issue_url(iid)
- end
-
- def fields
- [
- { type: 'text', name: 'description', placeholder: description },
- { type: 'text', name: 'project_url', placeholder: 'Project url' },
- { type: 'text', name: 'issues_url', placeholder: 'Issue url' },
- { type: 'text', name: 'new_issue_url', placeholder: 'New Issue url' }
- ]
- end
-
- def initialize_properties
- if properties.nil?
- if enabled_in_gitlab_config
- self.properties = {
- title: issues_tracker['title'],
- project_url: add_issues_tracker_id(issues_tracker['project_url']),
- issues_url: add_issues_tracker_id(issues_tracker['issues_url']),
- new_issue_url: add_issues_tracker_id(issues_tracker['new_issue_url'])
- }
- else
- self.properties = {}
- end
- end
- end
-
- def supported_events
- %w(push)
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
-
- message = "#{self.type} was unable to reach #{self.project_url}. Check the url and try again."
- result = false
-
- begin
- url = URI.parse(self.project_url)
-
- if url.host && url.port
- http = Net::HTTP.start(url.host, url.port, { open_timeout: 5, read_timeout: 5 })
- response = http.head("/")
-
- if response
- message = "#{self.type} received response #{response.code} when attempting to connect to #{self.project_url}"
- result = true
- end
- end
- rescue Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED => error
- message = "#{self.type} had an error when trying to connect to #{self.project_url}: #{error.message}"
- end
- Rails.logger.info(message)
- result
- end
-
- private
-
- def enabled_in_gitlab_config
- Gitlab.config.issues_tracker &&
- Gitlab.config.issues_tracker.values.any? &&
- issues_tracker
- end
-
- def issues_tracker
- Gitlab.config.issues_tracker[to_param]
- end
-
- def add_issues_tracker_id(url)
- if self.project
- id = self.project.issues_tracker_id
-
- if id
- url = url.gsub(":issues_tracker_id", id)
- end
- end
-
- url
- end
-end
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
deleted file mode 100644
index fcd9dc2f33674ccd1fbd781434c542e1dc3cc298..0000000000000000000000000000000000000000
--- a/app/models/project_services/jira_service.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class JiraService < IssueTrackerService
- include Rails.application.routes.url_helpers
-
- prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
-
- def help
- issue_tracker_link = help_page_path("integration", "external-issue-tracker")
-
- line1 = "Setting `project_url`, `issues_url` and `new_issue_url` will "\
- "allow a user to easily navigate to the Jira issue tracker. "\
- "See the [integration doc](#{issue_tracker_link}) for details."
-
- line2 = 'Support for referencing commits and automatic closing of Jira issues directly ' \
- 'from GitLab is [available in GitLab EE.](http://doc.gitlab.com/ee/integration/jira.html)'
-
- [line1, line2].join("\n\n")
- end
-
- def title
- if self.properties && self.properties['title'].present?
- self.properties['title']
- else
- 'JIRA'
- end
- end
-
- def description
- if self.properties && self.properties['description'].present?
- self.properties['description']
- else
- 'Jira issue tracker'
- end
- end
-
- def to_param
- 'jira'
- end
-end
diff --git a/app/models/project_services/pivotaltracker_service.rb b/app/models/project_services/pivotaltracker_service.rb
deleted file mode 100644
index ade9ee97873999daa81fba4880cd736b9d6319aa..0000000000000000000000000000000000000000
--- a/app/models/project_services/pivotaltracker_service.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class PivotaltrackerService < Service
- include HTTParty
-
- prop_accessor :token
- validates :token, presence: true, if: :activated?
-
- def title
- 'PivotalTracker'
- end
-
- def description
- 'Project Management Software (Source Commits Endpoint)'
- end
-
- def to_param
- 'pivotaltracker'
- end
-
- def fields
- [
- { type: 'text', name: 'token', placeholder: '' }
- ]
- end
-
- def supported_events
- %w(push)
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
-
- url = 'https://www.pivotaltracker.com/services/v5/source_commits'
- data[:commits].each do |commit|
- message = {
- 'source_commit' => {
- 'commit_id' => commit[:id],
- 'author' => commit[:author][:name],
- 'url' => commit[:url],
- 'message' => commit[:message]
- }
- }
- PivotaltrackerService.post(
- url,
- body: message.to_json,
- headers: {
- 'Content-Type' => 'application/json',
- 'X-TrackerToken' => token
- }
- )
- end
- end
-end
diff --git a/app/models/project_services/pushover_service.rb b/app/models/project_services/pushover_service.rb
deleted file mode 100644
index 53edf522e9a729a5827911c85c04a8b049ad3d29..0000000000000000000000000000000000000000
--- a/app/models/project_services/pushover_service.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class PushoverService < Service
- include HTTParty
- base_uri 'https://api.pushover.net/1'
-
- prop_accessor :api_key, :user_key, :device, :priority, :sound
- validates :api_key, :user_key, :priority, presence: true, if: :activated?
-
- def title
- 'Pushover'
- end
-
- def description
- 'Pushover makes it easy to get real-time notifications on your Android device, iPhone, iPad, and Desktop.'
- end
-
- def to_param
- 'pushover'
- end
-
- def fields
- [
- { type: 'text', name: 'api_key', placeholder: 'Your application key' },
- { type: 'text', name: 'user_key', placeholder: 'Your user key' },
- { type: 'text', name: 'device', placeholder: 'Leave blank for all active devices' },
- { type: 'select', name: 'priority', choices:
- [
- ['Lowest Priority', -2],
- ['Low Priority', -1],
- ['Normal Priority', 0],
- ['High Priority', 1]
- ],
- default_choice: 0
- },
- { type: 'select', name: 'sound', choices:
- [
- ['Device default sound', nil],
- ['Pushover (default)', 'pushover'],
- ['Bike', 'bike'],
- ['Bugle', 'bugle'],
- ['Cash Register', 'cashregister'],
- ['Classical', 'classical'],
- ['Cosmic', 'cosmic'],
- ['Falling', 'falling'],
- ['Gamelan', 'gamelan'],
- ['Incoming', 'incoming'],
- ['Intermission', 'intermission'],
- ['Magic', 'magic'],
- ['Mechanical', 'mechanical'],
- ['Piano Bar', 'pianobar'],
- ['Siren', 'siren'],
- ['Space Alarm', 'spacealarm'],
- ['Tug Boat', 'tugboat'],
- ['Alien Alarm (long)', 'alien'],
- ['Climb (long)', 'climb'],
- ['Persistent (long)', 'persistent'],
- ['Pushover Echo (long)', 'echo'],
- ['Up Down (long)', 'updown'],
- ['None (silent)', 'none']
- ]
- },
- ]
- end
-
- def supported_events
- %w(push)
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
-
- ref = Gitlab::Git.ref_name(data[:ref])
- before = data[:before]
- after = data[:after]
-
- if Gitlab::Git.blank_ref?(before)
- message = "#{data[:user_name]} pushed new branch \"#{ref}\"."
- elsif Gitlab::Git.blank_ref?(after)
- message = "#{data[:user_name]} deleted branch \"#{ref}\"."
- else
- message = "#{data[:user_name]} push to branch \"#{ref}\"."
- end
-
- if data[:total_commits_count] > 0
- message << "\nTotal commits count: #{data[:total_commits_count]}"
- end
-
- pushover_data = {
- token: api_key,
- user: user_key,
- device: device,
- priority: priority,
- title: "#{project.name_with_namespace}",
- message: message,
- url: data[:repository][:homepage],
- url_title: "See project #{project.name_with_namespace}"
- }
-
- # Sound parameter MUST NOT be sent to API if not selected
- if sound
- pushover_data.merge!(sound: sound)
- end
-
- PushoverService.post('/messages.json', body: pushover_data)
- end
-end
diff --git a/app/models/project_services/redmine_service.rb b/app/models/project_services/redmine_service.rb
deleted file mode 100644
index dd9ba97ee1fac487d66f5315955002abef9da6d9..0000000000000000000000000000000000000000
--- a/app/models/project_services/redmine_service.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class RedmineService < IssueTrackerService
-
- prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
-
- def title
- if self.properties && self.properties['title'].present?
- self.properties['title']
- else
- 'Redmine'
- end
- end
-
- def description
- if self.properties && self.properties['description'].present?
- self.properties['description']
- else
- 'Redmine issue tracker'
- end
- end
-
- def to_param
- 'redmine'
- end
-end
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb
deleted file mode 100644
index 36d9874edd32d3b8d8a3f22c377458817858b935..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class SlackService < Service
- prop_accessor :webhook, :username, :channel
- validates :webhook, presence: true, if: :activated?
-
- def title
- 'Slack'
- end
-
- def description
- 'A team communication tool for the 21st century'
- end
-
- def to_param
- 'slack'
- end
-
- def fields
- [
- { type: 'text', name: 'webhook',
- placeholder: 'https://hooks.slack.com/services/...' },
- { type: 'text', name: 'username', placeholder: 'username' },
- { type: 'text', name: 'channel', placeholder: '#channel' }
- ]
- end
-
- def supported_events
- %w(push issue merge_request note tag_push)
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
- return unless webhook.present?
-
- object_kind = data[:object_kind]
-
- data = data.merge(
- project_url: project_url,
- project_name: project_name
- )
-
- # WebHook events often have an 'update' event that follows a 'open' or
- # 'close' action. Ignore update events for now to prevent duplicate
- # messages from arriving.
-
- message = \
- case object_kind
- when "push", "tag_push"
- PushMessage.new(data)
- when "issue"
- IssueMessage.new(data) unless is_update?(data)
- when "merge_request"
- MergeMessage.new(data) unless is_update?(data)
- when "note"
- NoteMessage.new(data)
- end
-
- opt = {}
- opt[:channel] = channel if channel
- opt[:username] = username if username
-
- if message
- notifier = Slack::Notifier.new(webhook, opt)
- notifier.ping(message.pretext, attachments: message.attachments)
- end
- end
-
- private
-
- def project_name
- project.name_with_namespace.gsub(/\s/, '')
- end
-
- def project_url
- project.web_url
- end
-
- def is_update?(data)
- data[:object_attributes][:action] == 'update'
- end
-end
-
-require "slack_service/issue_message"
-require "slack_service/push_message"
-require "slack_service/merge_message"
-require "slack_service/note_message"
diff --git a/app/models/project_services/slack_service/base_message.rb b/app/models/project_services/slack_service/base_message.rb
deleted file mode 100644
index aa00d6061a118473758411a0b7581836ff9db291..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service/base_message.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'slack-notifier'
-
-class SlackService
- class BaseMessage
- def initialize(params)
- raise NotImplementedError
- end
-
- def pretext
- format(message)
- end
-
- def attachments
- raise NotImplementedError
- end
-
- private
-
- def message
- raise NotImplementedError
- end
-
- def format(string)
- Slack::Notifier::LinkFormatter.format(string)
- end
-
- def attachment_color
- '#345'
- end
- end
-end
diff --git a/app/models/project_services/slack_service/issue_message.rb b/app/models/project_services/slack_service/issue_message.rb
deleted file mode 100644
index 5af24a80609352547ab9b5b29549f6cd463a3a07..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service/issue_message.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-class SlackService
- class IssueMessage < BaseMessage
- attr_reader :user_name
- attr_reader :title
- attr_reader :project_name
- attr_reader :project_url
- attr_reader :issue_iid
- attr_reader :issue_url
- attr_reader :action
- attr_reader :state
- attr_reader :description
-
- def initialize(params)
- @user_name = params[:user][:name]
- @project_name = params[:project_name]
- @project_url = params[:project_url]
-
- obj_attr = params[:object_attributes]
- obj_attr = HashWithIndifferentAccess.new(obj_attr)
- @title = obj_attr[:title]
- @issue_iid = obj_attr[:iid]
- @issue_url = obj_attr[:url]
- @action = obj_attr[:action]
- @state = obj_attr[:state]
- @description = obj_attr[:description]
- end
-
- def attachments
- return [] unless opened_issue?
-
- description_message
- end
-
- private
-
- def message
- "#{user_name} #{state} #{issue_link} in #{project_link}: *#{title}*"
- end
-
- def opened_issue?
- action == "open"
- end
-
- def description_message
- [{ text: format(description), color: attachment_color }]
- end
-
- def project_link
- "[#{project_name}](#{project_url})"
- end
-
- def issue_link
- "[issue ##{issue_iid}](#{issue_url})"
- end
- end
-end
diff --git a/app/models/project_services/slack_service/merge_message.rb b/app/models/project_services/slack_service/merge_message.rb
deleted file mode 100644
index e792c258f7394a5e6e1c12dd222c75cd93d39620..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service/merge_message.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-class SlackService
- class MergeMessage < BaseMessage
- attr_reader :user_name
- attr_reader :project_name
- attr_reader :project_url
- attr_reader :merge_request_id
- attr_reader :source_branch
- attr_reader :target_branch
- attr_reader :state
- attr_reader :title
-
- def initialize(params)
- @user_name = params[:user][:name]
- @project_name = params[:project_name]
- @project_url = params[:project_url]
-
- obj_attr = params[:object_attributes]
- obj_attr = HashWithIndifferentAccess.new(obj_attr)
- @merge_request_id = obj_attr[:iid]
- @source_branch = obj_attr[:source_branch]
- @target_branch = obj_attr[:target_branch]
- @state = obj_attr[:state]
- @title = format_title(obj_attr[:title])
- end
-
- def pretext
- format(message)
- end
-
- def attachments
- []
- end
-
- private
-
- def format_title(title)
- '*' + title.lines.first.chomp + '*'
- end
-
- def message
- merge_request_message
- end
-
- def project_link
- "[#{project_name}](#{project_url})"
- end
-
- def merge_request_message
- "#{user_name} #{state} #{merge_request_link} in #{project_link}: #{title}"
- end
-
- def merge_request_link
- "[merge request ##{merge_request_id}](#{merge_request_url})"
- end
-
- def merge_request_url
- "#{project_url}/merge_requests/#{merge_request_id}"
- end
- end
-end
diff --git a/app/models/project_services/slack_service/note_message.rb b/app/models/project_services/slack_service/note_message.rb
deleted file mode 100644
index 074478b292da5ef73cd6cd7860bf0893404d1cfa..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service/note_message.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-class SlackService
- class NoteMessage < BaseMessage
- attr_reader :message
- attr_reader :user_name
- attr_reader :project_name
- attr_reader :project_link
- attr_reader :note
- attr_reader :note_url
- attr_reader :title
-
- def initialize(params)
- params = HashWithIndifferentAccess.new(params)
- @user_name = params[:user][:name]
- @project_name = params[:project_name]
- @project_url = params[:project_url]
-
- obj_attr = params[:object_attributes]
- obj_attr = HashWithIndifferentAccess.new(obj_attr)
- @note = obj_attr[:note]
- @note_url = obj_attr[:url]
- noteable_type = obj_attr[:noteable_type]
-
- case noteable_type
- when "Commit"
- create_commit_note(HashWithIndifferentAccess.new(params[:commit]))
- when "Issue"
- create_issue_note(HashWithIndifferentAccess.new(params[:issue]))
- when "MergeRequest"
- create_merge_note(HashWithIndifferentAccess.new(params[:merge_request]))
- when "Snippet"
- create_snippet_note(HashWithIndifferentAccess.new(params[:snippet]))
- end
- end
-
- def attachments
- description_message
- end
-
- private
-
- def format_title(title)
- title.lines.first.chomp
- end
-
- def create_commit_note(commit)
- commit_sha = commit[:id]
- commit_sha = Commit.truncate_sha(commit_sha)
- commit_link = "[commit #{commit_sha}](#{@note_url})"
- title = format_title(commit[:message])
- @message = "#{@user_name} commented on #{commit_link} in #{project_link}: *#{title}*"
- end
-
- def create_issue_note(issue)
- issue_iid = issue[:iid]
- note_link = "[issue ##{issue_iid}](#{@note_url})"
- title = format_title(issue[:title])
- @message = "#{@user_name} commented on #{note_link} in #{project_link}: *#{title}*"
- end
-
- def create_merge_note(merge_request)
- merge_request_id = merge_request[:iid]
- merge_request_link = "[merge request ##{merge_request_id}](#{@note_url})"
- title = format_title(merge_request[:title])
- @message = "#{@user_name} commented on #{merge_request_link} in #{project_link}: *#{title}*"
- end
-
- def create_snippet_note(snippet)
- snippet_id = snippet[:id]
- snippet_link = "[snippet ##{snippet_id}](#{@note_url})"
- title = format_title(snippet[:title])
- @message = "#{@user_name} commented on #{snippet_link} in #{project_link}: *#{title}*"
- end
-
- def description_message
- [{ text: format(@note), color: attachment_color }]
- end
-
- def project_link
- "[#{@project_name}](#{@project_url})"
- end
- end
-end
diff --git a/app/models/project_services/slack_service/push_message.rb b/app/models/project_services/slack_service/push_message.rb
deleted file mode 100644
index b26f3e9ddce9f392d6cc06e9446fb03a49fa1de3..0000000000000000000000000000000000000000
--- a/app/models/project_services/slack_service/push_message.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-class SlackService
- class PushMessage < BaseMessage
- attr_reader :after
- attr_reader :before
- attr_reader :commits
- attr_reader :project_name
- attr_reader :project_url
- attr_reader :ref
- attr_reader :ref_type
- attr_reader :user_name
-
- def initialize(params)
- @after = params[:after]
- @before = params[:before]
- @commits = params.fetch(:commits, [])
- @project_name = params[:project_name]
- @project_url = params[:project_url]
- @ref_type = Gitlab::Git.tag_ref?(params[:ref]) ? 'tag' : 'branch'
- @ref = Gitlab::Git.ref_name(params[:ref])
- @user_name = params[:user_name]
- end
-
- def pretext
- format(message)
- end
-
- def attachments
- return [] if new_branch? || removed_branch?
-
- commit_message_attachments
- end
-
- private
-
- def message
- if new_branch?
- new_branch_message
- elsif removed_branch?
- removed_branch_message
- else
- push_message
- end
- end
-
- def format(string)
- Slack::Notifier::LinkFormatter.format(string)
- end
-
- def new_branch_message
- "#{user_name} pushed new #{ref_type} #{branch_link} to #{project_link}"
- end
-
- def removed_branch_message
- "#{user_name} removed #{ref_type} #{ref} from #{project_link}"
- end
-
- def push_message
- "#{user_name} pushed to #{ref_type} #{branch_link} of #{project_link} (#{compare_link})"
- end
-
- def commit_messages
- commits.map { |commit| compose_commit_message(commit) }.join("\n")
- end
-
- def commit_message_attachments
- [{ text: format(commit_messages), color: attachment_color }]
- end
-
- def compose_commit_message(commit)
- author = commit[:author][:name]
- id = Commit.truncate_sha(commit[:id])
- message = commit[:message]
- url = commit[:url]
-
- "[#{id}](#{url}): #{message} - #{author}"
- end
-
- def new_branch?
- Gitlab::Git.blank_ref?(before)
- end
-
- def removed_branch?
- Gitlab::Git.blank_ref?(after)
- end
-
- def branch_url
- "#{project_url}/commits/#{ref}"
- end
-
- def compare_url
- "#{project_url}/compare/#{before}...#{after}"
- end
-
- def branch_link
- "[#{ref}](#{branch_url})"
- end
-
- def project_link
- "[#{project_name}](#{project_url})"
- end
-
- def compare_link
- "[Compare changes](#{compare_url})"
- end
-
- def attachment_color
- '#345'
- end
- end
-end
diff --git a/app/models/project_services/teamcity_service.rb b/app/models/project_services/teamcity_service.rb
deleted file mode 100644
index 3c002a1634b8c9535e577f829145e27f1c224c9b..0000000000000000000000000000000000000000
--- a/app/models/project_services/teamcity_service.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-# note_events :boolean default(TRUE), not null
-#
-
-class TeamcityService < CiService
- include HTTParty
-
- prop_accessor :teamcity_url, :build_type, :username, :password
-
- validates :teamcity_url,
- presence: true,
- format: { with: /\A#{URI.regexp}\z/ }, if: :activated?
- validates :build_type, presence: true, if: :activated?
- validates :username,
- presence: true,
- if: ->(service) { service.password? }, if: :activated?
- validates :password,
- presence: true,
- if: ->(service) { service.username? }, if: :activated?
-
- attr_accessor :response
-
- after_save :compose_service_hook, if: :activated?
-
- def compose_service_hook
- hook = service_hook || build_service_hook
- hook.save
- end
-
- def title
- 'JetBrains TeamCity CI'
- end
-
- def description
- 'A continuous integration and build server'
- end
-
- def help
- 'The build configuration in Teamcity must use the build format '\
- 'number %build.vcs.number% '\
- 'you will also want to configure monitoring of all branches so merge '\
- 'requests build, that setting is in the vsc root advanced settings.'
- end
-
- def to_param
- 'teamcity'
- end
-
- def supported_events
- %w(push)
- end
-
- def fields
- [
- { type: 'text', name: 'teamcity_url',
- placeholder: 'TeamCity root URL like https://teamcity.example.com' },
- { type: 'text', name: 'build_type',
- placeholder: 'Build configuration ID' },
- { type: 'text', name: 'username',
- placeholder: 'A user with permissions to trigger a manual build' },
- { type: 'password', name: 'password' },
- ]
- end
-
- def build_info(sha)
- url = URI.parse("#{teamcity_url}/httpAuth/app/rest/builds/"\
- "branch:unspecified:any,number:#{sha}")
- auth = {
- username: username,
- password: password,
- }
- @response = HTTParty.get("#{url}", verify: false, basic_auth: auth)
- end
-
- def build_page(sha, ref)
- build_info(sha) if @response.nil? || !@response.code
-
- if @response.code != 200
- # If actual build link can't be determined,
- # send user to build summary page.
- "#{teamcity_url}/viewLog.html?buildTypeId=#{build_type}"
- else
- # If actual build link is available, go to build result page.
- built_id = @response['build']['id']
- "#{teamcity_url}/viewLog.html?buildId=#{built_id}"\
- "&buildTypeId=#{build_type}"
- end
- end
-
- def commit_status(sha, ref)
- build_info(sha) if @response.nil? || !@response.code
- return :error unless @response.code == 200 || @response.code == 404
-
- status = if @response.code == 404
- 'Pending'
- else
- @response['build']['status']
- end
-
- if status.include?('SUCCESS')
- 'success'
- elsif status.include?('FAILURE')
- 'failed'
- elsif status.include?('Pending')
- 'pending'
- else
- :error
- end
- end
-
- def execute(data)
- return unless supported_events.include?(data[:object_kind])
-
- auth = {
- username: username,
- password: password,
- }
-
- branch = Gitlab::Git.ref_name(data[:ref])
-
- self.class.post("#{teamcity_url}/httpAuth/app/rest/buildQueue",
- body: "Edit <%= resource_name.to_s.humanize %>
-
-<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
- <%= devise_error_messages! %>
-
-
- <%= f.email_field :email %>
- <%= f.text_field :name %>
- <%= f.password_field :password %>
- <%= f.password_field :password_confirmation %>
- <%= f.password_field :current_password %>Cancel your account
-
-
-<% end -%>
-
-<%- if devise_mapping.registerable? && controller_name != 'registrations' && gitlab_config.signup_enabled %>
- <%= link_to "Sign up", new_registration_path(resource_name) %>
-<% end -%>
-
-<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
-<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn" %>
-<% end -%>
-
-<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
-<% end -%>
-
-<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
-<% end -%>
diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml
deleted file mode 100644
index b647b906b712b27e56b9511f34dbc333e409f5bb..0000000000000000000000000000000000000000
--- a/app/views/devise/shared/_omniauth_box.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%p
- %span.light
- Sign in with
- - providers = additional_providers
- - providers.each do |provider|
- %span.light
- - if default_providers.include?(provider)
- = link_to oauth_image_tag(provider), omniauth_authorize_path(resource_name, provider), class: 'oauth-image-link'
- - else
- = link_to provider.to_s.titleize, omniauth_authorize_path(resource_name, provider), class: "btn"
diff --git a/app/views/devise/shared/_sign_in_link.html.haml b/app/views/devise/shared/_sign_in_link.html.haml
deleted file mode 100644
index fafc4b82f5394cf258ddc2fda1310b153b9a3537..0000000000000000000000000000000000000000
--- a/app/views/devise/shared/_sign_in_link.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%p
- %span.light
- Already have login and password?
- %strong
- = link_to "Sign in", new_session_path(resource_name)
diff --git a/app/views/devise/shared/_signin_box.html.haml b/app/views/devise/shared/_signin_box.html.haml
deleted file mode 100644
index c76574db457d3581a3c73a9599ce902e1572aeee..0000000000000000000000000000000000000000
--- a/app/views/devise/shared/_signin_box.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-.login-box
- - if signup_enabled?
- .login-heading
- %h3 Existing user? Sign in
- - else
- .login-heading
- %h3 Sign in
- .login-body
- - if ldap_enabled?
- %ul.nav.nav-tabs
- - @ldap_servers.each_with_index do |server, i|
- %li{class: (:active if i.zero?)}
- = link_to server['label'], "#tab-#{server['provider_name']}", 'data-toggle' => 'tab'
- - if signin_enabled?
- %li
- = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
- .tab-content
- - @ldap_servers.each_with_index do |server, i|
- %div.tab-pane{id: "tab-#{server['provider_name']}", class: (:active if i.zero?)}
- = render 'devise/sessions/new_ldap', server: server
- - if signin_enabled?
- %div#tab-signin.tab-pane
- = render 'devise/sessions/new_base'
-
- - elsif signin_enabled?
- = render 'devise/sessions/new_base'
diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml
deleted file mode 100644
index 9dc6aeffd5947b903780be359101ab3ae8aa2cb5..0000000000000000000000000000000000000000
--- a/app/views/devise/shared/_signup_box.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-.login-box
- - if signin_enabled?
- .login-heading
- %h3 New user? Create an account
- - else
- .login-heading
- %h3 Create an account
- .login-body
- = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
- .devise-errors
- = devise_error_messages!
- %div
- = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
- %div
- = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
- %div
- = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
- .form-group.append-bottom-20#password-strength
- = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
- %div
- = f.submit "Sign up", class: "btn-create btn"
-
-.clearfix.prepend-top-20
- %p
- %span.light Didn't receive a confirmation email?
- = succeed '.' do
- = link_to "Request a new one", new_confirmation_path(resource_name)
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb
deleted file mode 100644
index f9277d1673fe35c0ab7a80339cb20c1159871823..0000000000000000000000000000000000000000
--- a/app/views/devise/unlocks/new.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-Resend unlock instructions
-
-<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
- <%= devise_error_messages! %>
-
-
- <%= f.email_field :email %>Takeout/Google Code Project Hosting/GoogleCodeProjectHosting.json file.
- %li
- %p
- Upload GoogleCodeProjectHosting.json here:
- %p
- %input{type: "file", name: "dump_file", id: "dump_file"}
- %li
- %p
- Do you want to customize how Google Code email addresses and usernames are imported into GitLab?
- %p
- = label_tag :create_user_map_0 do
- = radio_button_tag :create_user_map, 0, true
- No, directly import the existing email addresses and usernames.
- %p
- = label_tag :create_user_map_1 do
- = radio_button_tag :create_user_map, 1, false
- Yes, let me map Google Code users to full names or GitLab users.
- %li
- %p
- = submit_tag 'Continue to the next step', class: "btn btn-create"
diff --git a/app/views/import/google_code/status.html.haml b/app/views/import/google_code/status.html.haml
deleted file mode 100644
index 2013b8c03c6e59489e27b6ee11650c89dbcc6b16..0000000000000000000000000000000000000000
--- a/app/views/import/google_code/status.html.haml
+++ /dev/null
@@ -1,49 +0,0 @@
-%h3.page-title
- %i.fa.fa-google
- Import projects from Google Code
-
-%p.light
- Select projects you want to import.
-%p.light
- Optionally, you can
- = link_to "customize", new_user_map_import_google_code_path
- how Google Code email addresses and usernames are imported into GitLab.
-%hr
-%p
- = button_tag 'Import all projects', class: "btn btn-success js-import-all"
-
-%table.table.import-jobs
- %thead
- %tr
- %th From Google Code
- %th To GitLab
- %th Status
- %tbody
- - @already_added_projects.each do |project|
- %tr{id: "project_#{project.id}", class: "#{project_status_css_class(project.import_status)}"}
- %td
- = link_to project.import_source, "https://code.google.com/p/#{project.import_source}", target: "_blank"
- %td
- %strong= link_to project.path_with_namespace, [project.namespace.becomes(Namespace), project]
- %td.job-status
- - if project.import_status == 'finished'
- %span
- %i.fa.fa-check
- done
- - elsif project.import_status == 'started'
- %i.fa.fa-spinner.fa-spin
- started
- - else
- = project.human_import_status_name
-
- - @repos.each do |repo|
- %tr{id: "repo_#{repo.id}"}
- %td
- = link_to repo.name, "https://code.google.com/p/#{repo.name}", target: "_blank"
- %td.import-target
- = "#{current_user.username}/#{repo.name}"
- %td.import-actions.job-status
- = button_tag "Import", class: "btn js-add-to-import"
-
-:coffeescript
- new ImporterStatus("#{jobs_import_google_code_path}", "#{import_google_code_path}")
diff --git a/app/views/invites/show.html.haml b/app/views/invites/show.html.haml
deleted file mode 100644
index ab0ecffe4d2b24524efc69007cfaa9a5324b7d3a..0000000000000000000000000000000000000000
--- a/app/views/invites/show.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-%h3.page-title Invitation
-
-%p
- You have been invited
- - if inviter = @member.created_by
- by
- = link_to inviter.name, user_url(inviter)
- to join
- - case @member.source
- - when Project
- - project = @member.source
- project
- %strong
- = link_to project.name_with_namespace, namespace_project_url(project.namespace, project)
- - when Group
- - group = @member.source
- group
- %strong
- = link_to group.name, group_url(group)
- as #{@member.human_access}.
-
-- if @member.source.users.include?(current_user)
- %p
- However, you are already a member of this #{@member.source.is_a?(Group) ? "group" : "project"}.
- Sign in using a different account to accept the invitation.
-- else
- .actions
- = link_to "Accept invitation", accept_invite_url(@token), method: :post, class: "btn btn-success"
- = link_to "Decline", decline_invite_url(@token), method: :post, class: "btn btn-danger prepend-left-10"
diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml
deleted file mode 100644
index 41c9c0b3af6dc2beafbe5cc9cb9b779f34726da1..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_first_page.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
--# Link to the "First" page
--# available local variables
--# url: url to the first page
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%span.first
- = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
diff --git a/app/views/kaminari/gitlab/_gap.html.haml b/app/views/kaminari/gitlab/_gap.html.haml
deleted file mode 100644
index 3ffd12f8587aa72b3929dbdcbfbaf999383111b6..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_gap.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
--# Non-link tag that stands for skipped pages...
--# available local variables
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%li{class: "page"}
- %span.page.gap
- = raw(t 'views.pagination.truncate')
diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml
deleted file mode 100644
index b03a206224c18a56c2c3cfca78c018a6aab795f4..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_last_page.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
--# Link to the "Last" page
--# available local variables
--# url: url to the last page
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%span.last
- = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
diff --git a/app/views/kaminari/gitlab/_next_page.html.haml b/app/views/kaminari/gitlab/_next_page.html.haml
deleted file mode 100644
index 00c5f0b6f4e3fc9a71c81d2a674fcaac213c856d..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_next_page.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
--# Link to the "Next" page
--# available local variables
--# url: url to the next page
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%li.next
- = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
diff --git a/app/views/kaminari/gitlab/_page.html.haml b/app/views/kaminari/gitlab/_page.html.haml
deleted file mode 100644
index a52d883b9a84611e1f272aaf001b04bfdefdda2d..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_page.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
--# Link showing page number
--# available local variables
--# page: a page object for "this" page
--# url: url to this page
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%li{class: "page#{' active' if page.current?}"}
- = link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml
deleted file mode 100644
index 4f7996e49961cd2468f0a8feb2e134b43c4f602a..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_paginator.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
--# The container tag
--# available local variables
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
--# paginator: the paginator that renders the pagination tags inside
-= paginator.render do
- %div.gl-pagination
- %ul.pagination
- = prev_page_tag unless current_page.first?
- - each_page do |page|
- - if page.left_outer? || page.right_outer? || page.inside_window?
- = page_tag page
- - elsif !page.was_truncated?
- = gap_tag
- = next_page_tag unless current_page.last?
diff --git a/app/views/kaminari/gitlab/_prev_page.html.haml b/app/views/kaminari/gitlab/_prev_page.html.haml
deleted file mode 100644
index f673abdb3ae8b6cc9859f1ede9d24a44e431c551..0000000000000000000000000000000000000000
--- a/app/views/kaminari/gitlab/_prev_page.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
--# Link to the "Previous" page
--# available local variables
--# url: url to the previous page
--# current_page: a page object for the currently displayed page
--# num_pages: total number of pages
--# per_page: number of items to fetch per page
--# remote: data-remote
-%li{class: "prev" }
- = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
diff --git a/app/views/layouts/_broadcast.html.haml b/app/views/layouts/_broadcast.html.haml
deleted file mode 100644
index e7d477c225eb35e812b6a592510b862f7e949eee..0000000000000000000000000000000000000000
--- a/app/views/layouts/_broadcast.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- if broadcast_message.present?
- .broadcast-message{ style: broadcast_styling(broadcast_message) }
- %i.fa.fa-bullhorn
- = broadcast_message.message
diff --git a/app/views/layouts/_collapse_button.html.haml b/app/views/layouts/_collapse_button.html.haml
deleted file mode 100644
index 2ed51d87ca1332d8c9d7b34ba3a7219b662a53f9..0000000000000000000000000000000000000000
--- a/app/views/layouts/_collapse_button.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- if nav_menu_collapsed?
- = link_to icon('angle-right'), '#', class: 'toggle-nav-collapse', title: "Open/Close"
-- else
- = link_to icon('angle-left'), '#', class: 'toggle-nav-collapse', title: "Open/Close"
diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml
deleted file mode 100644
index cc8ea066cb9b98e7b014e625fc0d05fbd803365e..0000000000000000000000000000000000000000
--- a/app/views/layouts/_flash.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-.flash-container
- - if alert
- .flash-alert
- = alert
-
- - elsif notice
- .flash-notice
- = notice
diff --git a/app/views/layouts/_google_analytics.html.haml b/app/views/layouts/_google_analytics.html.haml
deleted file mode 100644
index 81e03c7eff29dd0fdbd5cc945e0099da332dcc46..0000000000000000000000000000000000000000
--- a/app/views/layouts/_google_analytics.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-:javascript
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '#{extra_config.google_analytics_id}']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
deleted file mode 100644
index d12145651af0f5f833419a7e20aa63fa0affec46..0000000000000000000000000000000000000000
--- a/app/views/layouts/_head.html.haml
+++ /dev/null
@@ -1,28 +0,0 @@
-%head
- %meta{charset: "utf-8"}
- %meta{content: "GitLab Community Edition", name: "description"}
-
- %title
- = "#{title} | " if defined?(title)
- GitLab
- = favicon_link_tag 'favicon.ico'
- = stylesheet_link_tag "application", :media => "all"
- = stylesheet_link_tag "print", :media => "print"
- = javascript_include_tag "application"
- = csrf_meta_tags
- = include_gon
- %meta{name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1'}
- %meta{name: 'theme-color', content: '#474D57'}
-
- = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
- = render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
-
- -# Atom feed
- - if current_user
- - if controller_name == 'projects' && action_name == 'index'
- = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- - if @project && !@project.new_record?
- - if current_controller?(:tree, :commits)
- = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- - if current_controller?(:issues)
- = auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
deleted file mode 100644
index d58582c107a0e31307164313fdd9e9da74bf7fbf..0000000000000000000000000000000000000000
--- a/app/views/layouts/_head_panel.html.haml
+++ /dev/null
@@ -1,48 +0,0 @@
-%header.navbar.navbar-fixed-top.navbar-gitlab
- .navbar-inner
- .container
- %div.app_logo
- = link_to root_path, class: "home has_bottom_tooltip", title: "Dashboard" do
- = brand_header_logo
- %h1.title= title
-
- %button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
- %span.sr-only Toggle navigation
- %i.fa.fa-bars
-
- .navbar-collapse.collapse
- %ul.nav.navbar-nav
- %li.hidden-sm.hidden-xs
- = render "layouts/search"
- %li.visible-sm.visible-xs
- = link_to search_path, title: "Search", class: 'has_bottom_tooltip', 'data-original-title' => 'Search area' do
- %i.fa.fa-search
- %li
- = link_to help_path, title: 'Help', class: 'has_bottom_tooltip',
- 'data-original-title' => 'Help' do
- %i.fa.fa-question-circle
- %li
- = link_to explore_root_path, title: "Explore", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do
- %i.fa.fa-globe
- %li
- = link_to user_snippets_path(current_user), title: "Your snippets", class: 'has_bottom_tooltip', 'data-original-title' => 'Your snippets' do
- %i.fa.fa-clipboard
- - if current_user.is_admin?
- %li
- = link_to admin_root_path, title: "Admin area", class: 'has_bottom_tooltip', 'data-original-title' => 'Admin area' do
- %i.fa.fa-cogs
- - if current_user.can_create_project?
- %li
- = link_to new_project_path, title: "New project", class: 'has_bottom_tooltip', 'data-original-title' => 'New project' do
- %i.fa.fa-plus
- %li
- = link_to profile_path, title: "Profile settings", class: 'has_bottom_tooltip', 'data-original-title' => 'Profile settings"' do
- %i.fa.fa-user
- %li
- = link_to destroy_user_session_path, class: "logout", method: :delete, title: "Sign out", class: 'has_bottom_tooltip', 'data-original-title' => 'Sign out' do
- %i.fa.fa-sign-out
- %li.hidden-xs
- = link_to current_user, class: "profile-pic has_bottom_tooltip", id: 'profile-pic', 'data-original-title' => 'Your profile' do
- = image_tag avatar_icon(current_user.email, 60), alt: 'User activity'
-
-= render 'shared/outdated_browser'
diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml
deleted file mode 100644
index 3c58f10e759f30200430684c241545265cbe1e97..0000000000000000000000000000000000000000
--- a/app/views/layouts/_init_auto_complete.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-:javascript
- GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(@project.namespace, @project, type: @noteable.class, type_id: params[:id])}"
- GitLab.GfmAutoComplete.setup();
diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml
deleted file mode 100644
index 422966cdc5556d22e1dae102fd17636f3da6e2d0..0000000000000000000000000000000000000000
--- a/app/views/layouts/_page.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-- if defined?(sidebar)
- .page-with-sidebar{ class: nav_sidebar_class }
- = render "layouts/broadcast"
- .sidebar-wrapper
- = render(sidebar)
- .collapse-nav
- = render partial: 'layouts/collapse_button'
- .content-wrapper
- .container-fluid
- .content
- = render "layouts/flash"
- .clearfix
- = yield
-- else
- .container.navless-container
- .content
- = yield
-
-= yield :embedded_scripts
-
-:coffeescript
- $('.page-sidebar-collapsed .nav-sidebar a').tooltip placement: "right"
-
diff --git a/app/views/layouts/_page_title.html.haml b/app/views/layouts/_page_title.html.haml
deleted file mode 100644
index 54da507476388cd697beb27ad2e7dca6bb5b68df..0000000000000000000000000000000000000000
--- a/app/views/layouts/_page_title.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-- if content_for?(:page-title)
- = yield :page-title
diff --git a/app/views/layouts/_piwik.html.haml b/app/views/layouts/_piwik.html.haml
deleted file mode 100644
index 135e8daca266cca6e27fd2667b73e46be9d36c37..0000000000000000000000000000000000000000
--- a/app/views/layouts/_piwik.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-:javascript
- var _paq = _paq || [];
- _paq.push(["trackPageView"]);
- _paq.push(["enableLinkTracking"]);
-
- (function() {
- var u=(("https:" == document.location.protocol) ? "https" : "http") + "://#{extra_config.piwik_url}/";
- _paq.push(["setTrackerUrl", u+"piwik.php"]);
- _paq.push(["setSiteId", "#{extra_config.piwik_site_id}"]);
- var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
- g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
- })();
diff --git a/app/views/layouts/_public_head_panel.html.haml b/app/views/layouts/_public_head_panel.html.haml
deleted file mode 100644
index 3d6d2bfc00a9f4f4fd5232cfce0aa5a7d63a48b8..0000000000000000000000000000000000000000
--- a/app/views/layouts/_public_head_panel.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-%header.navbar.navbar-fixed-top.navbar-gitlab
- .navbar-inner
- .container
- %div.app_logo
- = link_to explore_root_path, class: "home" do
- = brand_header_logo
- %h1.title= title
-
- %button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
- %span.sr-only Toggle navigation
- %i.fa.fa-bars
-
- - unless current_controller?('sessions')
- .pull-right.hidden-xs
- = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-new append-right-10'
-
- .navbar-collapse.collapse
- %ul.nav.navbar-nav
- %li.visible-xs
- = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes')
-
-= render 'shared/outdated_browser'
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml
deleted file mode 100644
index 04f79846858dbe2c3b5094f57285e9db24b3ecb8..0000000000000000000000000000000000000000
--- a/app/views/layouts/_search.html.haml
+++ /dev/null
@@ -1,28 +0,0 @@
-.search
- = form_tag search_path, method: :get, class: 'navbar-form pull-left' do |f|
- = search_field_tag "search", nil, placeholder: search_placeholder, class: "search-input"
- = hidden_field_tag :group_id, @group.try(:id)
- - if @project && @project.persisted?
- = hidden_field_tag :project_id, @project.id
-
- - if current_controller?(:issues)
- = hidden_field_tag :scope, 'issues'
- - elsif current_controller?(:merge_requests)
- = hidden_field_tag :scope, 'merge_requests'
- - elsif current_controller?(:wikis)
- = hidden_field_tag :scope, 'wiki_blobs'
- - else
- = hidden_field_tag :search_code, true
-
- - if @snippet || @snippets
- = hidden_field_tag :snippets, true
- = hidden_field_tag :repository_ref, @ref
- = button_tag 'Go' if ENV['RAILS_ENV'] == 'test'
- .search-autocomplete-opts.hide{:'data-autocomplete-path' => search_autocomplete_path, :'data-autocomplete-project-id' => @project.try(:id), :'data-autocomplete-project-ref' => @ref }
-
-:javascript
- $('.search-input').on('keyup', function(e) {
- if (e.keyCode == 27) {
- $('.search-input').blur()
- }
- })
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
deleted file mode 100644
index ab84e87c300209e2a7d3a42c7c15e9d003d86f6c..0000000000000000000000000000000000000000
--- a/app/views/layouts/admin.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Admin area"
- %body{class: "#{app_theme} admin", :'data-page' => body_data_page}
- = render "layouts/head_panel", title: link_to("Admin area", admin_root_path)
- = render 'layouts/page', sidebar: 'layouts/nav/admin'
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
deleted file mode 100644
index 6bd8ac4adb85e4e9b9e6d8469963c36b0dd20fb0..0000000000000000000000000000000000000000
--- a/app/views/layouts/application.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Dashboard"
- %body{class: "#{app_theme} application", :'data-page' => body_data_page }
- = render "layouts/head_panel", title: link_to("Dashboard", root_path)
- = render 'layouts/page', sidebar: 'layouts/nav/dashboard'
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
deleted file mode 100644
index 6f805f1c9d1ccba4d3c62dae35b7d0e9e9399abf..0000000000000000000000000000000000000000
--- a/app/views/layouts/devise.html.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head"
- %body.ui_mars.login-page.application
- = render "layouts/broadcast"
- = render "layouts/public_head_panel", title: ''
- .container.navless-container
- .content
- = render "layouts/flash"
- .row.prepend-top-20
- .col-sm-5.pull-right
- = yield
- .col-sm-7.brand-holder.pull-left
- %h1
- = brand_title
- - if brand_item
- = brand_image
- = brand_text
- - else
- %h3 Open source software to collaborate on code
-
- %p
- Manage git repositories with fine grained access controls that keep your code secure.
- Perform code reviews and enhance collaboration with merge requests.
- Each project can also have an issue tracker and a wiki.
-
- - if extra_sign_in_text.present?
- = markdown(extra_sign_in_text)
-
- %hr
- .container
- .footer-links
- = link_to "Explore", explore_root_path
- = link_to "Documentation", "http://doc.gitlab.com/"
- = link_to "About GitLab", "https://about.gitlab.com/"
diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml
deleted file mode 100644
index e51fd4cb8208e4e758d1a3776b55bdd97f922f95..0000000000000000000000000000000000000000
--- a/app/views/layouts/errors.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Error"
- %body{class: "#{app_theme} application"}
- = render "layouts/head_panel", title: "" if current_user
- .container.navless-container
- = render "layouts/flash"
- .error-page
- = yield
diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml
deleted file mode 100644
index 2bd0b8d85c91b0e929ad7258eda7f791bbb82b89..0000000000000000000000000000000000000000
--- a/app/views/layouts/explore.html.haml
+++ /dev/null
@@ -1,30 +0,0 @@
-- page_title = 'Explore'
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: page_title
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/broadcast"
- - if current_user
- = render "layouts/head_panel", title: link_to(page_title, explore_root_path)
- - else
- = render "layouts/public_head_panel", title: link_to(page_title, explore_root_path)
- .container.navless-container
- .content
- .explore-title
- %h3
- Explore GitLab
- %p.lead
- Discover projects and groups. Share your projects with others
-
-
- %ul.nav.nav-tabs
- = nav_link(path: 'projects#trending') do
- = link_to 'Trending Projects', explore_root_path
- = nav_link(path: 'projects#starred') do
- = link_to 'Most Starred Projects', starred_explore_projects_path
- = nav_link(path: 'projects#index') do
- = link_to 'All Projects', explore_projects_path
- = nav_link(controller: :groups) do
- = link_to 'All Groups', explore_groups_path
-
- = yield
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
deleted file mode 100644
index f4a6bee15f68c6e6022179bb4378e7bca15a64af..0000000000000000000000000000000000000000
--- a/app/views/layouts/group.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: group_head_title
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/head_panel", title: link_to(@group.name, group_path(@group))
- = render 'layouts/page', sidebar: 'layouts/nav/group'
diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml
deleted file mode 100644
index 34efceb37d1c64c6028ebb13e3558578065aa51a..0000000000000000000000000000000000000000
--- a/app/views/layouts/nav/_admin.html.haml
+++ /dev/null
@@ -1,65 +0,0 @@
-%ul.nav.nav-sidebar
- = nav_link(controller: :dashboard, html_options: {class: 'home'}) do
- = link_to admin_root_path, title: "Stats" do
- %i.fa.fa-dashboard
- %span
- Overview
- = nav_link(controller: :projects) do
- = link_to admin_namespaces_projects_path, title: 'Projects' do
- %i.fa.fa-cube
- %span
- Projects
- = nav_link(controller: :users) do
- = link_to admin_users_path, title: 'Users' do
- %i.fa.fa-user
- %span
- Users
- = nav_link(controller: :groups) do
- = link_to admin_groups_path, title: 'Groups' do
- %i.fa.fa-group
- %span
- Groups
- = nav_link(controller: :deploy_keys) do
- = link_to admin_deploy_keys_path, title: 'Deploy Keys' do
- %i.fa.fa-key
- %span
- Deploy Keys
- = nav_link(controller: :logs) do
- = link_to admin_logs_path, title: 'Logs' do
- %i.fa.fa-file-text
- %span
- Logs
- = nav_link(controller: :broadcast_messages) do
- = link_to admin_broadcast_messages_path, title: 'Broadcast Messages' do
- %i.fa.fa-bullhorn
- %span
- Messages
- = nav_link(controller: :hooks) do
- = link_to admin_hooks_path, title: 'Hooks' do
- %i.fa.fa-external-link
- %span
- Hooks
- = nav_link(controller: :background_jobs) do
- = link_to admin_background_jobs_path, title: 'Background Jobs' do
- %i.fa.fa-cog
- %span
- Background Jobs
-
- = nav_link(controller: :applications) do
- = link_to admin_applications_path, title: 'Applications' do
- %i.fa.fa-cloud
- %span
- Applications
-
- = nav_link(controller: :services) do
- = link_to admin_application_settings_services_path, title: 'Service Templates' do
- %i.fa.fa-copy
- %span
- Service Templates
-
- = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do
- = link_to admin_application_settings_path, title: 'Settings' do
- %i.fa.fa-cogs
- %span
- Settings
-
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
deleted file mode 100644
index e4f630c6a18a317859c9cb33a8ea46dfa978813f..0000000000000000000000000000000000000000
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-%ul.nav.nav-sidebar
- = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
- = link_to root_path, title: 'Home', class: 'shortcuts-activity' do
- %i.fa.fa-dashboard
- %span
- Your Projects
- = nav_link(path: 'projects#starred') do
- = link_to starred_dashboard_projects_path, title: 'Starred Projects' do
- %i.fa.fa-star
- %span
- Starred Projects
- = nav_link(controller: :groups) do
- = link_to dashboard_groups_path, title: 'Groups' do
- %i.fa.fa-group
- %span
- Groups
- = nav_link(controller: :milestones) do
- = link_to dashboard_milestones_path, title: 'Milestones' do
- %i.fa.fa-clock-o
- %span
- Milestones
- = nav_link(path: 'dashboard#issues') do
- = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues' do
- %i.fa.fa-exclamation-circle
- %span
- Issues
- %span.count= current_user.assigned_issues.opened.count
- = nav_link(path: 'dashboard#merge_requests') do
- = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests' do
- %i.fa.fa-tasks
- %span
- Merge Requests
- %span.count= current_user.assigned_merge_requests.opened.count
- = nav_link(controller: :help) do
- = link_to help_path, title: 'Help' do
- %i.fa.fa-question-circle
- %span
- Help
diff --git a/app/views/layouts/nav/_group.html.haml b/app/views/layouts/nav/_group.html.haml
deleted file mode 100644
index f0d92b7a12c45e31b032773ba7996729345aff70..0000000000000000000000000000000000000000
--- a/app/views/layouts/nav/_group.html.haml
+++ /dev/null
@@ -1,42 +0,0 @@
-%ul.nav.nav-sidebar
- = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
- = link_to group_path(@group), title: "Home" do
- %i.fa.fa-dashboard
- %span
- Activity
- - if current_user
- = nav_link(controller: [:group, :milestones]) do
- = link_to group_milestones_path(@group), title: 'Milestones' do
- %i.fa.fa-clock-o
- %span
- Milestones
- = nav_link(path: 'groups#issues') do
- = link_to issues_group_path(@group), title: 'Issues' do
- %i.fa.fa-exclamation-circle
- %span
- Issues
- - if current_user
- %span.count= Issue.opened.of_group(@group).count
- = nav_link(path: 'groups#merge_requests') do
- = link_to merge_requests_group_path(@group), title: 'Merge Requests' do
- %i.fa.fa-tasks
- %span
- Merge Requests
- - if current_user
- %span.count= MergeRequest.opened.of_group(@group).count
- = nav_link(controller: [:group_members]) do
- = link_to group_group_members_path(@group), title: 'Members' do
- %i.fa.fa-users
- %span
- Members
-
- - if can?(current_user, :admin_group, @group)
- = nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
- = link_to edit_group_path(@group), title: 'Settings', class: "tab no-highlight" do
- %i.fa.fa-cogs
- %span
- Settings
- %i.fa.fa-angle-down
-
- - if group_settings_page?
- = render 'groups/settings_nav'
diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml
deleted file mode 100644
index d88e862829d6c44527d2b86a95efbe515287d8c0..0000000000000000000000000000000000000000
--- a/app/views/layouts/nav/_profile.html.haml
+++ /dev/null
@@ -1,50 +0,0 @@
-%ul.nav.nav-sidebar
- = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
- = link_to profile_path, title: "Profile" do
- %i.fa.fa-user
- %span
- Profile
- = nav_link(controller: :accounts) do
- = link_to profile_account_path, title: 'Account' do
- %i.fa.fa-gear
- %span
- Account
- = nav_link(path: ['profiles#applications', 'applications#edit', 'applications#show', 'applications#new']) do
- = link_to applications_profile_path, title: 'Applications' do
- %i.fa.fa-cloud
- %span
- Applications
- = nav_link(controller: :emails) do
- = link_to profile_emails_path, title: 'Emails' do
- %i.fa.fa-envelope-o
- %span
- Emails
- %span.count= current_user.emails.count + 1
- - unless current_user.ldap_user?
- = nav_link(controller: :passwords) do
- = link_to edit_profile_password_path, title: 'Password' do
- %i.fa.fa-lock
- %span
- Password
- = nav_link(controller: :notifications) do
- = link_to profile_notifications_path, title: 'Notifications' do
- %i.fa.fa-inbox
- %span
- Notifications
-
- = nav_link(controller: :keys) do
- = link_to profile_keys_path, title: 'SSH Keys' do
- %i.fa.fa-key
- %span
- SSH Keys
- %span.count= current_user.keys.count
- = nav_link(path: 'profiles#design') do
- = link_to design_profile_path, title: 'Design' do
- %i.fa.fa-image
- %span
- Design
- = nav_link(path: 'profiles#history') do
- = link_to history_profile_path, title: 'History' do
- %i.fa.fa-history
- %span
- History
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
deleted file mode 100644
index 6c13f30f62764ba7f79bd466a8e767391c0d4b46..0000000000000000000000000000000000000000
--- a/app/views/layouts/nav/_project.html.haml
+++ /dev/null
@@ -1,97 +0,0 @@
-%ul.project-navigation.nav.nav-sidebar
- - if @project_settings_nav
- = nav_link do
- = link_to project_path(@project), title: 'Back to project', class: "" do
- %i.fa.fa-caret-square-o-left
- %span
- Back to project
-
- %li.separate-item
-
- = render 'projects/settings_nav'
-
- - else
- = nav_link(path: 'projects#show', html_options: {class: "home"}) do
- = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
- %i.fa.fa-dashboard
- %span
- Project
- - if project_nav_tab? :files
- = nav_link(controller: %w(tree blob blame edit_tree new_tree)) do
- = link_to namespace_project_tree_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Files', class: 'shortcuts-tree' do
- %i.fa.fa-files-o
- %span
- Files
-
- - if project_nav_tab? :commits
- = nav_link(controller: %w(commit commits compare repositories tags branches)) do
- = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Commits', class: 'shortcuts-commits' do
- %i.fa.fa-history
- %span
- Commits
-
- - if project_nav_tab? :network
- = nav_link(controller: %w(network)) do
- = link_to namespace_project_network_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-network' do
- %i.fa.fa-code-fork
- %span
- Network
-
- - if project_nav_tab? :graphs
- = nav_link(controller: %w(graphs)) do
- = link_to namespace_project_graph_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-graphs' do
- %i.fa.fa-area-chart
- %span
- Graphs
-
- - if project_nav_tab? :milestones
- = nav_link(controller: :milestones) do
- = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do
- %i.fa.fa-clock-o
- %span
- Milestones
-
- - if project_nav_tab? :issues
- = nav_link(controller: :issues) do
- = link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues' do
- %i.fa.fa-exclamation-circle
- %span
- Issues
- - if @project.default_issues_tracker?
- %span.count.issue_counter= @project.issues.opened.count
-
- - if project_nav_tab? :merge_requests
- = nav_link(controller: :merge_requests) do
- = link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-merge_requests' do
- %i.fa.fa-tasks
- %span
- Merge Requests
- %span.count.merge_counter= @project.merge_requests.opened.count
-
- - if project_nav_tab? :labels
- = nav_link(controller: :labels) do
- = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do
- %i.fa.fa-tags
- %span
- Labels
-
- - if project_nav_tab? :wiki
- = nav_link(controller: :wikis) do
- = link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do
- %i.fa.fa-book
- %span
- Wiki
-
- - if project_nav_tab? :snippets
- = nav_link(controller: :snippets) do
- = link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets' do
- %i.fa.fa-file-text-o
- %span
- Snippets
-
- - if project_nav_tab? :settings
- = nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
- = link_to edit_project_path(@project), title: 'Settings', class: "stat-tab tab no-highlight" do
- %i.fa.fa-cogs
- %span
- Settings
diff --git a/app/views/layouts/navless.html.haml b/app/views/layouts/navless.html.haml
deleted file mode 100644
index 4d0278251a67ff87bd1914ceaed35437cd60ed17..0000000000000000000000000000000000000000
--- a/app/views/layouts/navless.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: @title
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/broadcast"
- = render "layouts/head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title
- .container.navless-container
- .content
- = render "layouts/flash"
- = yield
diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml
deleted file mode 100644
index 00c7cedce40da9ea45d8a1a586681f8d4c022595..0000000000000000000000000000000000000000
--- a/app/views/layouts/notify.html.haml
+++ /dev/null
@@ -1,42 +0,0 @@
-%html{lang: "en"}
- %head
- %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
- %title
- GitLab
- :css
- img {
- max-width: 100%;
- height: auto;
- }
- p.details {
- font-style:italic;
- color:#777
- }
- .footer p {
- font-size:small;
- color:#777
- }
- pre.commit-message {
- white-space: pre-wrap;
- }
- .file-stats a {
- text-decoration: none;
- }
- .file-stats .new-file {
- color: #090;
- }
- .file-stats .deleted-file {
- color: #B00;
- }}
- %body
- %div.content
- = yield
- %div.footer{style: "margin-top: 10px;"}
- %p
- \—
- %br
- - if @target_url
- #{link_to "View it on GitLab", @target_url}
- = email_action @target_url
- - if @project && !@disable_footer
- You're receiving this notification because you are a member of the #{link_to_unless @target_url, @project.name_with_namespace, namespace_project_url(@project.namespace, @project)} project team.
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
deleted file mode 100644
index 2b5be7fc37202a5ea3735941d94a44a6f96c055d..0000000000000000000000000000000000000000
--- a/app/views/layouts/profile.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Profile"
- %body{class: "#{app_theme} profile", :'data-page' => body_data_page}
- = render "layouts/head_panel", title: link_to("Profile", profile_path)
- = render 'layouts/page', sidebar: 'layouts/nav/profile'
diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml
deleted file mode 100644
index 0a0039dec169e5f5d5d047685ebf29e1d7fbc8a3..0000000000000000000000000000000000000000
--- a/app/views/layouts/project_settings.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: @project.name_with_namespace
- %body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
- = render "layouts/head_panel", title: project_title(@project)
- = render "layouts/init_auto_complete"
- - @project_settings_nav = true
- = render 'layouts/page', sidebar: 'layouts/nav/project'
diff --git a/app/views/layouts/projects.html.haml b/app/views/layouts/projects.html.haml
deleted file mode 100644
index dde0964f47f4961035bcf2467b24438ee0602404..0000000000000000000000000000000000000000
--- a/app/views/layouts/projects.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: project_head_title
- %body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
- = render "layouts/head_panel", title: project_title(@project)
- = render "layouts/init_auto_complete"
- = render 'layouts/page', sidebar: 'layouts/nav/project'
diff --git a/app/views/layouts/public_group.html.haml b/app/views/layouts/public_group.html.haml
deleted file mode 100644
index b9b1d03e08ee8a05288b207fcfbad755778f6da4..0000000000000000000000000000000000000000
--- a/app/views/layouts/public_group.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: group_head_title
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/public_head_panel", title: link_to(@group.name, group_path(@group))
- = render 'layouts/page', sidebar: 'layouts/nav/group'
diff --git a/app/views/layouts/public_projects.html.haml b/app/views/layouts/public_projects.html.haml
deleted file mode 100644
index 04fa7c84e73c75ccaf700be683062e90fa0ce75e..0000000000000000000000000000000000000000
--- a/app/views/layouts/public_projects.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: @project.name_with_namespace
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/public_head_panel", title: project_title(@project)
- = render 'layouts/page', sidebar: 'layouts/nav/project'
diff --git a/app/views/layouts/public_users.html.haml b/app/views/layouts/public_users.html.haml
deleted file mode 100644
index 71c16bd168418d1a0771abe37c692c26f12178c5..0000000000000000000000000000000000000000
--- a/app/views/layouts/public_users.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: @title
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/public_head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title
- = render 'layouts/page'
diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml
deleted file mode 100644
index f9d8db06e10635c0023a48fe20b103b6a851e2d8..0000000000000000000000000000000000000000
--- a/app/views/layouts/search.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Search"
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/broadcast"
- = render "layouts/head_panel", title: link_to("Search", search_path)
- .container.navless-container
- .content
- = render "layouts/flash"
- = yield
diff --git a/app/views/notify/_note_message.html.haml b/app/views/notify/_note_message.html.haml
deleted file mode 100644
index 3fd4b04ac8456a42f591a3f77fa197866e873c72..0000000000000000000000000000000000000000
--- a/app/views/notify/_note_message.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%div
- = markdown(@note.note, reference_only_path: false)
diff --git a/app/views/notify/_reassigned_issuable_email.html.haml b/app/views/notify/_reassigned_issuable_email.html.haml
deleted file mode 100644
index 56d81b2ed2e074eddefce56844eddf3f241027d3..0000000000000000000000000000000000000000
--- a/app/views/notify/_reassigned_issuable_email.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%p
- Assignee changed
- - if @previous_assignee
- from
- %strong #{@previous_assignee.name}
- to
- - if issuable.assignee_id
- %strong #{issuable.assignee_name}
- - else
- %strong Unassigned
diff --git a/app/views/notify/_reassigned_issuable_email.text.erb b/app/views/notify/_reassigned_issuable_email.text.erb
deleted file mode 100644
index 855d37429d9fe64adc541e280366f5901b23be9c..0000000000000000000000000000000000000000
--- a/app/views/notify/_reassigned_issuable_email.text.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-Reassigned <%= issuable.class.model_name.human.titleize %> <%= issuable.iid %>
-
-<%= url_for([issuable.project.namespace.becomes(Namespace), issuable.project, issuable, {only_path: false}]) %>
-
-Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee -%>
- to <%= "#{issuable.assignee_id ? issuable.assignee_name : 'Unassigned'}" %>
diff --git a/app/views/notify/closed_issue_email.html.haml b/app/views/notify/closed_issue_email.html.haml
deleted file mode 100644
index 56c18cd83cd6fc688b923d355a33050801518487..0000000000000000000000000000000000000000
--- a/app/views/notify/closed_issue_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%p
- = "Issue was closed by #{@updated_by.name}"
diff --git a/app/views/notify/closed_issue_email.text.haml b/app/views/notify/closed_issue_email.text.haml
deleted file mode 100644
index ac703b31eddf5d4f6ea739612a122b1274f58902..0000000000000000000000000000000000000000
--- a/app/views/notify/closed_issue_email.text.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-= "Issue was closed by #{@updated_by.name}"
-
-Issue ##{@issue.iid}: #{namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)}
diff --git a/app/views/notify/closed_merge_request_email.html.haml b/app/views/notify/closed_merge_request_email.html.haml
deleted file mode 100644
index 574e8bfef245a06fe81d8b1540ce683d5fc128de..0000000000000000000000000000000000000000
--- a/app/views/notify/closed_merge_request_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%p
- = "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}"
diff --git a/app/views/notify/closed_merge_request_email.text.haml b/app/views/notify/closed_merge_request_email.text.haml
deleted file mode 100644
index 59db86b08bc404062f8723b0fb6689e295b25bdb..0000000000000000000000000000000000000000
--- a/app/views/notify/closed_merge_request_email.text.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-= "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}"
-
-Merge Request url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
-
-= merge_path_description(@merge_request, 'to')
-
-Author: #{@merge_request.author_name}
-Assignee: #{@merge_request.assignee_name}
diff --git a/app/views/notify/group_access_granted_email.html.haml b/app/views/notify/group_access_granted_email.html.haml
deleted file mode 100644
index f1916d624b6b35d9fabe1808660022197e8b324d..0000000000000000000000000000000000000000
--- a/app/views/notify/group_access_granted_email.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%p
- = "You have been granted #{@group_member.human_access} access to group"
- = link_to group_url(@group) do
- = @group.name
diff --git a/app/views/notify/group_access_granted_email.text.erb b/app/views/notify/group_access_granted_email.text.erb
deleted file mode 100644
index ef9617bfc16ad3d47aa75524e5d28a379ca1639b..0000000000000000000000000000000000000000
--- a/app/views/notify/group_access_granted_email.text.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-
-You have been granted <%= @group_member.human_access %> access to group <%= @group.name %>
-
-<%= url_for(group_url(@group)) %>
diff --git a/app/views/notify/group_invite_accepted_email.html.haml b/app/views/notify/group_invite_accepted_email.html.haml
deleted file mode 100644
index 55efad384a79552ba51ee49935e04fcdc9a53c1e..0000000000000000000000000000000000000000
--- a/app/views/notify/group_invite_accepted_email.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%p
- #{@group_member.invite_email}, now known as
- #{link_to @group_member.user.name, user_url(@group_member.user)},
- has accepted your invitation to join group
- #{link_to @group.name, group_url(@group)}.
-
diff --git a/app/views/notify/group_invite_accepted_email.text.erb b/app/views/notify/group_invite_accepted_email.text.erb
deleted file mode 100644
index f8b70f7a5a60c8d617cd94e3db88a91da13c8007..0000000000000000000000000000000000000000
--- a/app/views/notify/group_invite_accepted_email.text.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= @group_member.invite_email %>, now known as <%= @group_member.user.name %>, has accepted your invitation to join group <%= @group.name %>.
-
-<%= group_url(@group) %>
diff --git a/app/views/notify/group_invite_declined_email.html.haml b/app/views/notify/group_invite_declined_email.html.haml
deleted file mode 100644
index f9525d84fac655d96f2dbaced015467d4bcad1fa..0000000000000000000000000000000000000000
--- a/app/views/notify/group_invite_declined_email.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%p
- #{@invite_email}
- has declined your invitation to join group
- #{link_to @group.name, group_url(@group)}.
-
diff --git a/app/views/notify/group_invite_declined_email.text.erb b/app/views/notify/group_invite_declined_email.text.erb
deleted file mode 100644
index 6c19a288d15fb2030a5c814645fbd4484156c276..0000000000000000000000000000000000000000
--- a/app/views/notify/group_invite_declined_email.text.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= @invite_email %> has declined your invitation to join group <%= @group.name %>.
-
-<%= group_url(@group) %>
diff --git a/app/views/notify/group_member_invited_email.html.haml b/app/views/notify/group_member_invited_email.html.haml
deleted file mode 100644
index 163e88bfea3b455a6fd478ed25236f703d681372..0000000000000000000000000000000000000000
--- a/app/views/notify/group_member_invited_email.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%p
- You have been invited
- - if inviter = @group_member.created_by
- by
- = link_to inviter.name, user_url(inviter)
- to join group
- = link_to @group.name, group_url(@group)
- as #{@group_member.human_access}.
-
-%p
- = link_to 'Accept invitation', invite_url(@token)
- or
- = link_to 'decline', decline_invite_url(@token)
-
diff --git a/app/views/notify/group_member_invited_email.text.erb b/app/views/notify/group_member_invited_email.text.erb
deleted file mode 100644
index 28ce4819b14eedf5132758b9e88db81bb6d10940..0000000000000000000000000000000000000000
--- a/app/views/notify/group_member_invited_email.text.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-You have been invited <%= "by #{@group_member.created_by.name} " if @group_member.created_by %>to join group <%= @group.name %> as <%= @group_member.human_access %>.
-
-Accept invitation: <%= invite_url(@token) %>
-Decline invitation: <%= decline_invite_url(@token) %>
diff --git a/app/views/notify/issue_status_changed_email.html.haml b/app/views/notify/issue_status_changed_email.html.haml
deleted file mode 100644
index 482c884a9dbde497e3101a5c0d53fbce9a9467ae..0000000000000000000000000000000000000000
--- a/app/views/notify/issue_status_changed_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%p
- = "Issue was #{@issue_status} by #{@updated_by.name}"
diff --git a/app/views/notify/issue_status_changed_email.text.erb b/app/views/notify/issue_status_changed_email.text.erb
deleted file mode 100644
index e6ab3fcde7705471517f92f92114475ab90876c4..0000000000000000000000000000000000000000
--- a/app/views/notify/issue_status_changed_email.text.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue was <%= @issue_status %> by <%= @updated_by.name %>
-
-Issue <%= @issue.iid %>: <%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)) %>
-
diff --git a/app/views/notify/merge_request_status_email.html.haml b/app/views/notify/merge_request_status_email.html.haml
deleted file mode 100644
index c9bf04f514e107ac9565a8df8604943cf6251866..0000000000000000000000000000000000000000
--- a/app/views/notify/merge_request_status_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%p
- = "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}"
diff --git a/app/views/notify/merge_request_status_email.text.haml b/app/views/notify/merge_request_status_email.text.haml
deleted file mode 100644
index b96dd0fd8abb901acb088d37cfd2841c77c31fbd..0000000000000000000000000000000000000000
--- a/app/views/notify/merge_request_status_email.text.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-= "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}"
-
-Merge Request url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
-
-= merge_path_description(@merge_request, 'to')
-
-Author: #{@merge_request.author_name}
-Assignee: #{@merge_request.assignee_name}
diff --git a/app/views/notify/merged_merge_request_email.html.haml b/app/views/notify/merged_merge_request_email.html.haml
deleted file mode 100644
index 6762fae7f64f3c7fd2c3394441341305572c6429..0000000000000000000000000000000000000000
--- a/app/views/notify/merged_merge_request_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-%p
- = "Merge Request ##{@merge_request.iid} was merged"
diff --git a/app/views/notify/merged_merge_request_email.text.haml b/app/views/notify/merged_merge_request_email.text.haml
deleted file mode 100644
index 9db75bdb19e48aff9b07415aedda6b07429fefcb..0000000000000000000000000000000000000000
--- a/app/views/notify/merged_merge_request_email.text.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-= "Merge Request ##{@merge_request.iid} was merged"
-
-Merge Request Url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
-
-= merge_path_description(@merge_request, 'to')
-
-Author: #{@merge_request.author_name}
-Assignee: #{@merge_request.assignee_name}
diff --git a/app/views/notify/new_email_email.html.haml b/app/views/notify/new_email_email.html.haml
deleted file mode 100644
index 4a0448a573ccd2f9387174404e4301a84d0473da..0000000000000000000000000000000000000000
--- a/app/views/notify/new_email_email.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%p
- Hi #{@user.name}!
-%p
- A new email was added to your account:
-%p
- email:
- %code= @email.email
-%p
- If this email was added in error, you can remove it here:
- = link_to "Emails", profile_emails_url
diff --git a/app/views/notify/new_email_email.text.erb b/app/views/notify/new_email_email.text.erb
deleted file mode 100644
index 51cba99ad0d695ed9ff107f7ebaf6b6d86a3a4a1..0000000000000000000000000000000000000000
--- a/app/views/notify/new_email_email.text.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-Hi <%= @user.name %>!
-
-A new email was added to your account:
-
-email.................. <%= @email.email %>
-
-If this email was added in error, you can remove it here: <%= profile_emails_url %>
diff --git a/app/views/notify/new_issue_email.html.haml b/app/views/notify/new_issue_email.html.haml
deleted file mode 100644
index 53a068be52e5b1c53a380f32a9bcf91cc480638e..0000000000000000000000000000000000000000
--- a/app/views/notify/new_issue_email.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
--if @issue.description
- = markdown(@issue.description, reference_only_path: false)
-
-- if @issue.assignee_id.present?
- %p
- Assignee: #{@issue.assignee_name}
diff --git a/app/views/notify/new_issue_email.text.erb b/app/views/notify/new_issue_email.text.erb
deleted file mode 100644
index 0cc629354985870100d6ac548af74ffdc8ca8d40..0000000000000000000000000000000000000000
--- a/app/views/notify/new_issue_email.text.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-New Issue was created.
-
-Issue <%= @issue.iid %>: <%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)) %>
-Author: <%= @issue.author_name %>
-Asignee: <%= @issue.assignee_name %>
diff --git a/app/views/notify/new_merge_request_email.html.haml b/app/views/notify/new_merge_request_email.html.haml
deleted file mode 100644
index 5b7dd117c16afd159c0a427bc7022dc2a83e04e3..0000000000000000000000000000000000000000
--- a/app/views/notify/new_merge_request_email.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-%p.details
- != merge_path_description(@merge_request, '→')
-
-- if @merge_request.assignee_id.present?
- %p
- Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name}
-
--if @merge_request.description
- = markdown(@merge_request.description, reference_only_path: false)
diff --git a/app/views/notify/new_merge_request_email.text.erb b/app/views/notify/new_merge_request_email.text.erb
deleted file mode 100644
index f08039ad045c39f745a2d2400823032f9a4a3d58..0000000000000000000000000000000000000000
--- a/app/views/notify/new_merge_request_email.text.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-New Merge Request #<%= @merge_request.iid %>
-
-<%= url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)) %>
-
-<%= merge_path_description(@merge_request, 'to') %>
-Author: <%= @merge_request.author_name %>
-Asignee: <%= @merge_request.assignee_name %>
-
diff --git a/app/views/notify/new_ssh_key_email.html.haml b/app/views/notify/new_ssh_key_email.html.haml
deleted file mode 100644
index 63b0cbbd2051a7deaf9bb7519848f382ed15621f..0000000000000000000000000000000000000000
--- a/app/views/notify/new_ssh_key_email.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%p
- Hi #{@user.name}!
-%p
- A new public key was added to your account:
-%p
- title:
- %code= @key.title
-%p
- If this key was added in error, you can remove it under
- = link_to "SSH Keys", profile_keys_url
diff --git a/app/views/notify/new_ssh_key_email.text.erb b/app/views/notify/new_ssh_key_email.text.erb
deleted file mode 100644
index 05b551c89a02cddd9826da2ac0aed6129fd9b9d9..0000000000000000000000000000000000000000
--- a/app/views/notify/new_ssh_key_email.text.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-Hi <%= @user.name %>!
-
-A new public key was added to your account:
-
-Title: <%= @key.title %>
-
-If this key was added in error, you can remove it at <%= profile_keys_url %>
diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml
deleted file mode 100644
index ebbe98dd472fe38b2ac76d7181b6b9f85ba79b09..0000000000000000000000000000000000000000
--- a/app/views/notify/new_user_email.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%p
- Hi #{@user['name']}!
-%p
- - if Gitlab.config.gitlab.signup_enabled
- Your account has been created successfully.
- - else
- The Administrator created an account for you. Now you are a member of the company GitLab application.
-%p
- login..........................................
- %code= @user['email']
-
-- if @user.created_by_id
- %p
- = link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token)
diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb
deleted file mode 100644
index 96b26879a7720820b861fa6109b89574a5c37122..0000000000000000000000000000000000000000
--- a/app/views/notify/new_user_email.text.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-Hi <%= @user.name %>!
-
-The Administrator created an account for you. Now you are a member of the company GitLab application.
-
-login.................. <%= @user.email %>
-<% if @user.created_by_id %>
- <%= link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token) %>
-<% end %>
diff --git a/app/views/notify/note_commit_email.html.haml b/app/views/notify/note_commit_email.html.haml
deleted file mode 100644
index 1d961e4424c6b5238902774678a6009d6d94b72f..0000000000000000000000000000000000000000
--- a/app/views/notify/note_commit_email.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-= render 'note_message'
-
diff --git a/app/views/notify/note_commit_email.text.erb b/app/views/notify/note_commit_email.text.erb
deleted file mode 100644
index aaeaf5fdf731c498ea6a46f570b9e7e9c5e924f7..0000000000000000000000000000000000000000
--- a/app/views/notify/note_commit_email.text.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-New comment for Commit <%= @commit.short_id %>
-
-<%= url_for(namespace_project_commit_url(@note.project.namespace, @note.project, id: @commit.id, anchor: "note_#{@note.id}")) %>
-
-
-Author: <%= @note.author_name %>
-
-<%= @note.note %>
-
diff --git a/app/views/notify/note_issue_email.html.haml b/app/views/notify/note_issue_email.html.haml
deleted file mode 100644
index 2fa2f7846611da52652a8307e29b3992409f1606..0000000000000000000000000000000000000000
--- a/app/views/notify/note_issue_email.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render 'note_message'
diff --git a/app/views/notify/note_issue_email.text.erb b/app/views/notify/note_issue_email.text.erb
deleted file mode 100644
index e33cbcd70f2298d4b286f825c61fc5f71e32c195..0000000000000000000000000000000000000000
--- a/app/views/notify/note_issue_email.text.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-New comment for Issue <%= @issue.iid %>
-
-<%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue, anchor: "note_#{@note.id}")) %>
-
-
-Author: <%= @note.author_name %>
-
-<%= @note.note %>
-
diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml
deleted file mode 100644
index 65f0e4c4068fbb3fbcdb3d0f358b1a1c9064698e..0000000000000000000000000000000000000000
--- a/app/views/notify/note_merge_request_email.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-- if @note.diff_file_name
- %p.details
- New comment on diff for
- = link_to @note.diff_file_name, @target_url
- \:
-
-= render 'note_message'
diff --git a/app/views/notify/note_merge_request_email.text.erb b/app/views/notify/note_merge_request_email.text.erb
deleted file mode 100644
index 1d1411992a653493d1b5fb1f35f584ee6b004efc..0000000000000000000000000000000000000000
--- a/app/views/notify/note_merge_request_email.text.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-New comment for Merge Request <%= @merge_request.iid %>
-
-<%= url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %>
-
-
-<%= @note.author_name %>
-
-<%= @note.note %>
-
diff --git a/app/views/notify/project_access_granted_email.html.haml b/app/views/notify/project_access_granted_email.html.haml
deleted file mode 100644
index dfc30a2d360cd312cfdb959731994ea6cafa8138..0000000000000000000000000000000000000000
--- a/app/views/notify/project_access_granted_email.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%p
- = "You have been granted #{@project_member.human_access} access to project"
-%p
- = link_to namespace_project_url(@project.namespace, @project) do
- = @project.name_with_namespace
diff --git a/app/views/notify/project_access_granted_email.text.erb b/app/views/notify/project_access_granted_email.text.erb
deleted file mode 100644
index 68eb1611ba7e6f4e73faa8d09ca8de7d01892ba9..0000000000000000000000000000000000000000
--- a/app/views/notify/project_access_granted_email.text.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-
-You have been granted <%= @project_member.human_access %> access to project <%= @project.name_with_namespace %>
-
-<%= url_for(namespace_project_url(@project.namespace, @project)) %>
diff --git a/app/views/notify/project_invite_accepted_email.html.haml b/app/views/notify/project_invite_accepted_email.html.haml
deleted file mode 100644
index 7e58d30b10a89eaca450b4ee0cae8cd451dd1eff..0000000000000000000000000000000000000000
--- a/app/views/notify/project_invite_accepted_email.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%p
- #{@project_member.invite_email}, now known as
- #{link_to @project_member.user.name, user_url(@project_member.user)},
- has accepted your invitation to join project
- #{link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)}.
-
diff --git a/app/views/notify/project_invite_accepted_email.text.erb b/app/views/notify/project_invite_accepted_email.text.erb
deleted file mode 100644
index fcbe752114dace69c69679b299f93cf1e3672751..0000000000000000000000000000000000000000
--- a/app/views/notify/project_invite_accepted_email.text.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= @project_member.invite_email %>, now known as <%= @project_member.user.name %>, has accepted your invitation to join project <%= @project.name_with_namespace %>.
-
-<%= namespace_project_url(@project.namespace, @project) %>
diff --git a/app/views/notify/project_invite_declined_email.html.haml b/app/views/notify/project_invite_declined_email.html.haml
deleted file mode 100644
index c2d7e6f6e3a0aed662a768042970f210c80099e2..0000000000000000000000000000000000000000
--- a/app/views/notify/project_invite_declined_email.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%p
- #{@invite_email}
- has declined your invitation to join project
- #{link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)}.
-
diff --git a/app/views/notify/project_invite_declined_email.text.erb b/app/views/notify/project_invite_declined_email.text.erb
deleted file mode 100644
index 484687fa51cbeef4ea3527d3b96e62c3e6bc2117..0000000000000000000000000000000000000000
--- a/app/views/notify/project_invite_declined_email.text.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= @invite_email %> has declined your invitation to join project <%= @project.name_with_namespace %>.
-
-<%= namespace_project_url(@project.namespace, @project) %>
diff --git a/app/views/notify/project_member_invited_email.html.haml b/app/views/notify/project_member_invited_email.html.haml
deleted file mode 100644
index 79eb89616de49402bfdde544b88fcfa633248b10..0000000000000000000000000000000000000000
--- a/app/views/notify/project_member_invited_email.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%p
- You have been invited
- - if inviter = @project_member.created_by
- by
- = link_to inviter.name, user_url(inviter)
- to join project
- = link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)
- as #{@project_member.human_access}.
-
-%p
- = link_to 'Accept invitation', invite_url(@token)
- or
- = link_to 'decline', decline_invite_url(@token)
diff --git a/app/views/notify/project_member_invited_email.text.erb b/app/views/notify/project_member_invited_email.text.erb
deleted file mode 100644
index e07062721158bb29e0a0131e03dd912224d708ff..0000000000000000000000000000000000000000
--- a/app/views/notify/project_member_invited_email.text.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-You have been invited <%= "by #{@project_member.created_by.name} " if @project_member.created_by %>to join project <%= @project.name_with_namespace %> as <%= @project_member.human_access %>.
-
-Accept invitation: <%= invite_url(@token) %>
-Decline invitation: <%= decline_invite_url(@token) %>
diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml
deleted file mode 100644
index 3cd759f1f5766f91cc0f08414640bc767dcd59dc..0000000000000000000000000000000000000000
--- a/app/views/notify/project_was_moved_email.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-%p
- Project was moved to another location
-%p
- The project is now located under
- = link_to namespace_project_url(@project.namespace, @project) do
- = @project.name_with_namespace
-%p
- To update the remote url in your local repository run (for ssh):
-%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" }
- git remote set-url origin #{@project.ssh_url_to_repo}
-%p
- or for http(s):
-%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" }
- git remote set-url origin #{@project.http_url_to_repo}
-%br
diff --git a/app/views/notify/project_was_moved_email.text.erb b/app/views/notify/project_was_moved_email.text.erb
deleted file mode 100644
index b3f18b35a4d606a0b46dcddc9ffe3faafef02576..0000000000000000000000000000000000000000
--- a/app/views/notify/project_was_moved_email.text.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-Project was moved to another location
-
-The project is now located under
-<%= namespace_project_url(@project.namespace, @project) %>
-
-
-To update the remote url in your local repository run (for ssh):
- git remote set-url origin <%= @project.ssh_url_to_repo %>
-or for http(s):
- git remote set-url origin <%= @project.http_url_to_repo %>
diff --git a/app/views/notify/reassigned_issue_email.html.haml b/app/views/notify/reassigned_issue_email.html.haml
deleted file mode 100644
index 498ba8b83651b2fd1ecfe1212b96fa7dc9cee651..0000000000000000000000000000000000000000
--- a/app/views/notify/reassigned_issue_email.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render 'reassigned_issuable_email', issuable: @issue
diff --git a/app/views/notify/reassigned_issue_email.text.erb b/app/views/notify/reassigned_issue_email.text.erb
deleted file mode 100644
index 710253be9842975d9d0e4d27948814d4d5c87768..0000000000000000000000000000000000000000
--- a/app/views/notify/reassigned_issue_email.text.erb
+++ /dev/null
@@ -1 +0,0 @@
-<%= render 'reassigned_issuable_email', issuable: @issue %>
diff --git a/app/views/notify/reassigned_merge_request_email.html.haml b/app/views/notify/reassigned_merge_request_email.html.haml
deleted file mode 100644
index 2a650130f59ce19c289bf2014d230e7acf72c195..0000000000000000000000000000000000000000
--- a/app/views/notify/reassigned_merge_request_email.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render 'reassigned_issuable_email', issuable: @merge_request
diff --git a/app/views/notify/reassigned_merge_request_email.text.erb b/app/views/notify/reassigned_merge_request_email.text.erb
deleted file mode 100644
index b5b4f1ff99a6b3128835d48891143643a2a390cc..0000000000000000000000000000000000000000
--- a/app/views/notify/reassigned_merge_request_email.text.erb
+++ /dev/null
@@ -1 +0,0 @@
-<%= render 'reassigned_issuable_email', issuable: @merge_request %>
diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml
deleted file mode 100644
index a374a662333248d89faeb25e811a47cc03f2b429..0000000000000000000000000000000000000000
--- a/app/views/notify/repository_push_email.html.haml
+++ /dev/null
@@ -1,66 +0,0 @@
-%h3 #{@author.name} #{@action_name} #{@ref_type} #{@ref_name} at #{link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)}
-
-- if @compare
- - if @reverse_compare
- %p
- %strong WARNING:
- The push did not contain any new commits, but force pushed to delete the commits and changes below.
-
- %h4
- = @reverse_compare ? "Deleted commits:" : "Commits:"
-
- %ul
- - @commits.each do |commit|
- %li
- %strong #{link_to commit.short_id, namespace_project_commit_url(@project.namespace, @project, commit)}
- %div
- %span by #{commit.author_name}
- %i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")}
- %pre.commit-message
- = commit.safe_message
-
- %h4 #{pluralize @diffs.count, "changed file"}:
-
- %ul
- - @diffs.each_with_index do |diff, i|
- %li.file-stats
- %a{href: "#{@target_url if @disable_diffs}#diff-#{i}" }
- - if diff.deleted_file
- %span.deleted-file
- −
- = diff.old_path
- - elsif diff.renamed_file
- = diff.old_path
- →
- = diff.new_path
- - elsif diff.new_file
- %span.new-file
- +
- = diff.new_path
- - else
- = diff.new_path
-
- - unless @disable_diffs
- %h4 Changes:
- - @diffs.each_with_index do |diff, i|
- %li{id: "diff-#{i}"}
- %a{href: @target_url + "#diff-#{i}"}
- - if diff.deleted_file
- %strong
- = diff.old_path
- deleted
- - elsif diff.renamed_file
- %strong
- = diff.old_path
- →
- %strong
- = diff.new_path
- - else
- %strong
- = diff.new_path
- %hr
- = color_email_diff(diff.diff)
- %br
-
- - if @compare.timeout
- %h5 Huge diff. To prevent performance issues changes are hidden
diff --git a/app/views/notify/repository_push_email.text.haml b/app/views/notify/repository_push_email.text.haml
deleted file mode 100644
index 97a176ed2a3800577ce0ec8340c0c6d7428c41dc..0000000000000000000000000000000000000000
--- a/app/views/notify/repository_push_email.text.haml
+++ /dev/null
@@ -1,49 +0,0 @@
-#{@author.name} #{@action_name} #{@ref_type} #{@ref_name} at #{@project.name_with_namespace}
-- if @compare
- \
- \
- - if @reverse_compare
- WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.
- \
- \
- = @reverse_compare ? "Deleted commits:" : "Commits:"
- - @commits.each do |commit|
- #{commit.short_id} by #{commit.author_name} at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")}
- #{commit.safe_message}
- \- - - - -
- \
- \
- #{pluralize @diffs.count, "changed file"}:
- \
- - @diffs.each do |diff|
- - if diff.deleted_file
- \- − #{diff.old_path}
- - elsif diff.renamed_file
- \- #{diff.old_path} → #{diff.new_path}
- - elsif diff.new_file
- \- + #{diff.new_path}
- - else
- \- #{diff.new_path}
- - unless @disable_diffs
- \
- \
- Changes:
- - @diffs.each do |diff|
- \
- \=====================================
- - if diff.deleted_file
- #{diff.old_path} deleted
- - elsif diff.renamed_file
- #{diff.old_path} → #{diff.new_path}
- - else
- = diff.new_path
- \=====================================
- != diff.diff
- - if @compare.timeout
- \
- \
- Huge diff. To prevent performance issues it was hidden
- - if @target_url
- \
- \
- View it on GitLab: #{@target_url}
diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml
deleted file mode 100644
index 5bffb4acc1d7530c08a00d699be68843c1680684..0000000000000000000000000000000000000000
--- a/app/views/profiles/accounts/show.html.haml
+++ /dev/null
@@ -1,77 +0,0 @@
-- if current_user.ldap_user?
- .alert.alert-info
- Some options are unavailable for LDAP accounts
-
-.account-page
- %fieldset.update-token
- %legend
- Reset Private token
- %div
- = form_for @user, url: reset_private_token_profile_path, method: :put do |f|
- .data
- %p
- Your private token is used to access application resources without authentication.
- %br
- It can be used for atom feeds or the API.
- %span.cred
- Keep it secret!
-
- %p.cgray
- - if current_user.private_token
- = text_field_tag "token", current_user.private_token, class: "form-control"
- %div
- = f.submit 'Reset private token', data: { confirm: "Are you sure?" }, class: "btn btn-primary btn-build-token"
- - else
- %span You don`t have one yet. Click generate to fix it.
- = f.submit 'Generate', class: "btn success btn-build-token"
-
-
- - if show_profile_social_tab?
- %fieldset
- %legend Connected Accounts
- .oauth-buttons.append-bottom-10
- %p Click on icon to activate signin with one of the following services
- - enabled_social_providers.each do |provider|
- .btn-group
- = link_to oauth_image_tag(provider), omniauth_authorize_path(User, provider),
- class: "btn btn-lg #{'active' if oauth_active?(provider)}"
- - if oauth_active?(provider)
- = link_to unlink_profile_account_path(provider: provider), method: :delete, class: 'btn btn-lg' do
- %i.fa.fa-close
-
- - if show_profile_username_tab?
- %fieldset.update-username
- %legend
- Change Username
- = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
- %p
- Changing your username will change path to all personal projects!
- %div
- = f.text_field :username, required: true, class: 'form-control'
-
- .loading-gif.hide
- %p
- %i.fa.fa-spinner.fa-spin
- Saving new username
- %p.light
- = user_url(@user)
- %div
- = f.submit 'Save username', class: "btn btn-warning"
-
- - if show_profile_remove_tab?
- %fieldset.remove-account
- %legend
- Remove account
- %div
- %p Deleting an account has the following effects:
- %ul
- %li All user content like authored issues, snippets, comments will be removed
- - rp = current_user.personal_projects.count
- - unless rp.zero?
- %li #{pluralize rp, 'personal project'} will be removed and cannot be restored
- - if current_user.solo_owned_groups.present?
- %li
- The following groups will be abandoned. You should transfer or remove them:
- %strong #{current_user.solo_owned_groups.map(&:name).join(', ')}
- = link_to 'Delete account', user_registration_path, data: { confirm: "REMOVE #{current_user.name}? Are you sure?" }, method: :delete, class: "btn btn-remove"
-
diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml
deleted file mode 100644
index 97e98948f36647b7021e32cd3bd7e769365f75c0..0000000000000000000000000000000000000000
--- a/app/views/profiles/applications.html.haml
+++ /dev/null
@@ -1,49 +0,0 @@
-%h3.page-title
- Application Settings
-%p.light
- OAuth2 protocol settings below.
-
-%fieldset.oauth-applications
- %legend Your applications
- %p= link_to 'New Application', new_oauth_application_path, class: 'btn btn-success'
- - if @applications.any?
- %table.table.table-striped
- %thead
- %tr
- %th Name
- %th Callback URL
- %th Clients
- %th
- %th
- %tbody
- - @applications.each do |application|
- %tr{:id => "application_#{application.id}"}
- %td= link_to application.name, oauth_application_path(application)
- %td
- - application.redirect_uri.split.each do |uri|
- %div= uri
- %td= application.access_tokens.count
- %td= link_to 'Edit', edit_oauth_application_path(application), class: 'btn btn-link btn-sm'
- %td= render 'doorkeeper/applications/delete_form', application: application
-
-%fieldset.oauth-authorized-applications.prepend-top-20
- %legend Authorized applications
-
- - if @authorized_tokens.any?
- %table.table.table-striped
- %thead
- %tr
- %th Name
- %th Authorized At
- %th Scope
- %th
- %tbody
- - @authorized_apps.each do |app|
- - token = app.authorized_tokens.order('created_at desc').first
- %tr{:id => "application_#{app.id}"}
- %td= app.name
- %td= token.created_at
- %td= token.scopes
- %td= render 'doorkeeper/authorized_applications/delete_form', application: app
- - else
- %p.light You dont have any authorized applications
diff --git a/app/views/profiles/design.html.haml b/app/views/profiles/design.html.haml
deleted file mode 100644
index cc00d08d03b526230d2a8566801d8ea0139c9da4..0000000000000000000000000000000000000000
--- a/app/views/profiles/design.html.haml
+++ /dev/null
@@ -1,53 +0,0 @@
-%h3.page-title
- Design Settings
-%p.light
- Appearance settings will be saved to your profile and made available across all devices.
-%hr
-
-= form_for @user, url: profile_path, remote: true, method: :put do |f|
- %fieldset.application-theme
- %legend
- Application theme
- .themes_opts
- = label_tag do
- .prev.default
- = f.radio_button :theme_id, 1
- Default
-
- = label_tag do
- .prev.classic
- = f.radio_button :theme_id, 2
- Classic
-
- = label_tag do
- .prev.modern
- = f.radio_button :theme_id, 3
- Modern
-
- = label_tag do
- .prev.gray
- = f.radio_button :theme_id, 4
- Gray
-
- = label_tag do
- .prev.violet
- = f.radio_button :theme_id, 5
- Violet
-
- = label_tag do
- .prev.blue
- = f.radio_button :theme_id, 6
- Blue
- %br
- .clearfix
-
- %fieldset.code-preview-theme
- %legend
- Code preview theme
- .code_highlight_opts
- - color_schemes.each do |color_scheme_id, color_scheme|
- = label_tag do
- .prev
- = image_tag "#{color_scheme}-scheme-preview.png"
- = f.radio_button :color_scheme_id, color_scheme_id
- = color_scheme.gsub(/[-_]+/, ' ').humanize
diff --git a/app/views/profiles/emails/index.html.haml b/app/views/profiles/emails/index.html.haml
deleted file mode 100644
index 09f290429eacb2f97599daf3ea46e26df180fd15..0000000000000000000000000000000000000000
--- a/app/views/profiles/emails/index.html.haml
+++ /dev/null
@@ -1,41 +0,0 @@
-%h3.page-title
- Email Settings
-%p.light
- Your
- %b Primary Email
- will be used for avatar detection and web based operations, such as edits and merges.
- %br
- Your
- %b Notification Email
- will be used for account notifications.
- %br
- All email addresses will be used to identify your commits.
-
-%hr
-
-.panel.panel-default
- .panel-heading
- Emails (#{@emails.count + 1})
- %ul.well-list#emails-table
- %li
- %strong= @primary
- %span.label.label-success Primary Email
- - if @primary === @public_email
- %span.label.label-info Public Email
- - @emails.each do |email|
- %li
- %strong= email.email
- - if email.email === @public_email
- %span.label.label-info Public Email
- %span.cgray
- added #{time_ago_with_tooltip(email.created_at)}
- = link_to 'Remove', profile_email_path(email), data: { confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-sm btn-remove pull-right'
-
-%h4 Add email address
-= form_for 'email', url: profile_emails_path, html: { class: 'form-horizontal' } do |f|
- .form-group
- = f.label :email, class: 'control-label'
- .col-sm-10
- = f.text_field :email, class: 'form-control'
- .form-actions
- = f.submit 'Add email address', class: 'btn btn-create'
diff --git a/app/views/profiles/history.html.haml b/app/views/profiles/history.html.haml
deleted file mode 100644
index b1ab433f48fb90552dd70f288b7a62fd86c34e50..0000000000000000000000000000000000000000
--- a/app/views/profiles/history.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%h3.page-title
- Your Account History
-%p.light
- All events created by your account are listed below.
-%hr
-.profile_history
- = render @events
-%hr
-= paginate @events, theme: "gitlab"
-
diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml
deleted file mode 100644
index f905417f0e2bf905705b939f19fe3235decc51a6..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/_form.html.haml
+++ /dev/null
@@ -1,21 +0,0 @@
-%div
- = form_for [:profile, @key], html: { class: 'form-horizontal' } do |f|
- - if @key.errors.any?
- .alert.alert-danger
- %ul
- - @key.errors.full_messages.each do |msg|
- %li= msg
-
- .form-group
- = f.label :title, class: 'control-label'
- .col-sm-10= f.text_field :title, class: "form-control"
- .form-group
- = f.label :key, class: 'control-label'
- .col-sm-10
- = f.text_area :key, class: "form-control", rows: 8
-
-
- .form-actions
- = f.submit 'Add key', class: "btn btn-create"
- = link_to "Cancel", profile_keys_path, class: "btn btn-cancel"
-
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
deleted file mode 100644
index fe5770f45c383d54ae38223a193facfaa361d5d4..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/_key.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-%tr
- %td
- = link_to path_to_key(key, is_admin) do
- %strong= key.title
- %td
- %span
- (#{key.fingerprint})
- %td
- %span.cgray
- added #{time_ago_with_tooltip(key.created_at)}
- %td
- = link_to 'Remove', path_to_key(key, is_admin), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"
diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml
deleted file mode 100644
index 8bac22a2e1a8130d1a3a4169d509871b792b39fe..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/_key_details.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-- is_admin = defined?(admin) ? true : false
-.row
- .col-md-4
- .panel.panel-default
- .panel-heading
- SSH Key
- %ul.well-list
- %li
- %span.light Title:
- %strong= @key.title
- %li
- %span.light Created on:
- %strong= @key.created_at.stamp("Aug 21, 2011")
-
- .col-md-8
- %p
- %span.light Fingerprint:
- %strong= @key.fingerprint
- %pre.well-pre
- = @key.key
- .pull-right
- = link_to 'Remove', path_to_key(@key, is_admin), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key"
diff --git a/app/views/profiles/keys/_key_table.html.haml b/app/views/profiles/keys/_key_table.html.haml
deleted file mode 100644
index ef0075aad3b20598c45a21fed3453a8cd65131b6..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/_key_table.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-- is_admin = defined?(admin) ? true : false
-.panel.panel-default
- - if @keys.any?
- %table.table
- %thead.panel-heading
- %tr
- %th Title
- %th Fingerprint
- %th Added at
- %th
- %tbody
- - @keys.each do |key|
- = render 'profiles/keys/key', key: key, is_admin: is_admin
- - else
- .nothing-here-block
- - if is_admin
- User has no ssh keys
- - else
- There are no SSH keys with access to your account.
diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml
deleted file mode 100644
index 0904c50c88b99e8fffa697fa317c30786cc2b474..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/index.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%h3.page-title
- SSH Keys Settings
- .pull-right
- = link_to "Add SSH Key", new_profile_key_path, class: "btn btn-new"
-%p.light
- Before you can add an SSH key you need to
- = link_to "generate it.", help_page_path("ssh", "README")
-%hr
-
-= render 'key_table'
diff --git a/app/views/profiles/keys/new.html.haml b/app/views/profiles/keys/new.html.haml
deleted file mode 100644
index ccec716d0c66f02c9c6d86e6802251ea668a5740..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/new.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-%h3.page-title Add an SSH Key
-%p.light
- Paste your public key here. Read more about how to generate a key on #{link_to "the SSH help page", help_page_path("ssh", "README")}.
-%hr
-= render 'form'
-
-:javascript
- $('#key_key').on('focusout', function(){
- var title = $('#key_title'),
- val = $('#key_key').val(),
- comment = val.match(/^\S+ \S+ (.+)$/);
-
- if( comment && comment.length > 1 && title.val() == '' ){
- $('#key_title').val( comment[1] );
- }
- });
diff --git a/app/views/profiles/keys/show.html.haml b/app/views/profiles/keys/show.html.haml
deleted file mode 100644
index cfd53298962f50c7b1fd064a3421568ad8084e3d..0000000000000000000000000000000000000000
--- a/app/views/profiles/keys/show.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "key_details"
diff --git a/app/views/profiles/notifications/_settings.html.haml b/app/views/profiles/notifications/_settings.html.haml
deleted file mode 100644
index 2c85d2a9b2bb6223f033fafd3a24f99105c68f75..0000000000000000000000000000000000000000
--- a/app/views/profiles/notifications/_settings.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-%li
- %span.notification.fa.fa-holder
- - if notification.global?
- = notification_icon(@notification)
- - else
- = notification_icon(notification)
-
- %span.str-truncated
- - if membership.kind_of? GroupMember
- = link_to membership.group.name, membership.group
- - else
- = link_to_project(membership.project)
- .pull-right
- = form_tag profile_notifications_path, method: :put, remote: true, class: 'update-notifications' do
- = hidden_field_tag :notification_type, type, id: dom_id(membership, 'notification_type')
- = hidden_field_tag :notification_id, membership.id, id: dom_id(membership, 'notification_id')
- = select_tag :notification_level, options_for_select(Notification.options_with_labels, notification.level), class: 'trigger-submit'
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml
deleted file mode 100644
index 273e72f8a4dfc26bf133cbc98afeee4c4107b6a0..0000000000000000000000000000000000000000
--- a/app/views/profiles/notifications/show.html.haml
+++ /dev/null
@@ -1,78 +0,0 @@
-%h3.page-title
- Notifications Settings
-%p.light
- These are your global notification settings.
-%hr
-
-= form_for @user, url: profile_notifications_path, method: :put, html: { class: 'update-notifications form-horizontal global-notifications-form' } do |f|
- -if @user.errors.any?
- %div.alert.alert-danger
- %ul
- - @user.errors.full_messages.each do |msg|
- %li= msg
-
- = hidden_field_tag :notification_type, 'global'
-
- .form-group
- = f.label :notification_email, class: "control-label"
- .col-sm-10
- = f.select :notification_email, @user.all_emails, { include_blank: false }, class: "form-control"
-
- .form-group
- = f.label :notification_level, class: 'control-label'
- .col-sm-10
- .radio
- = f.label :notification_level, value: Notification::N_DISABLED do
- = f.radio_button :notification_level, Notification::N_DISABLED
- .level-title
- Disabled
- %p You will not get any notifications via email
-
- .radio
- = f.label :notification_level, value: Notification::N_MENTION do
- = f.radio_button :notification_level, Notification::N_MENTION
- .level-title
- Mention
- %p You will receive notifications only for comments in which you were @mentioned
-
- .radio
- = f.label :notification_level, value: Notification::N_PARTICIPATING do
- = f.radio_button :notification_level, Notification::N_PARTICIPATING
- .level-title
- Participating
- %p You will only receive notifications from related resources (e.g. from your commits or assigned issues)
-
- .radio
- = f.label :notification_level, value: Notification::N_WATCH do
- = f.radio_button :notification_level, Notification::N_WATCH
- .level-title
- Watch
- %p You will receive all notifications from projects in which you participate
-
- .form-actions
- = f.submit 'Save changes', class: "btn btn-create"
-
-.clearfix
- %hr
-.row.all-notifications
- .col-md-6
- %p
- You can also specify notification level per group or per project.
- %br
- By default, all projects and groups will use the notification level set above.
- %h4 Groups:
- %ul.bordered-list
- - @group_members.each do |group_member|
- - notification = Notification.new(group_member)
- = render 'settings', type: 'group', membership: group_member, notification: notification
-
- .col-md-6
- %p
- To specify the notification level per project of a group you belong to,
- %br
- you need to be a member of the project itself, not only its group.
- %h4 Projects:
- %ul.bordered-list
- - @project_members.each do |project_member|
- - notification = Notification.new(project_member)
- = render 'settings', type: 'project', membership: project_member, notification: notification
diff --git a/app/views/profiles/notifications/update.js.haml b/app/views/profiles/notifications/update.js.haml
deleted file mode 100644
index 84c6ab25599e4356f30a14c33264d884a51b3e07..0000000000000000000000000000000000000000
--- a/app/views/profiles/notifications/update.js.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-- if @saved
- :plain
- new Flash("Notification settings saved", "notice")
-- else
- :plain
- new Flash("Failed to save new settings", "alert")
diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml
deleted file mode 100644
index 4b04b113e89bd35066320a600811ad8a679210c3..0000000000000000000000000000000000000000
--- a/app/views/profiles/passwords/edit.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-%h3.page-title Password Settings
-%p.light
- - if @user.password_automatically_set?
- Set your password.
- - else
- Change your password or recover your current one.
-%hr
-.update-password
- = form_for @user, url: profile_password_path, method: :put, html: { class: 'form-horizontal' } do |f|
- %div
- %p.slead
- - unless @user.password_automatically_set?
- You must provide current password in order to change it.
- %br
- After a successful password update, you will be redirected to the login page where you can log in with your new password.
- -if @user.errors.any?
- .alert.alert-danger
- %ul
- - @user.errors.full_messages.each do |msg|
- %li= msg
- - unless @user.password_automatically_set?
- .form-group
- = f.label :current_password, class: 'control-label'
- .col-sm-10
- = f.password_field :current_password, required: true, class: 'form-control'
- %div
- = link_to "Forgot your password?", reset_profile_password_path, method: :put
-
- .form-group
- = f.label :password, 'New password', class: 'control-label'
- .col-sm-10
- = f.password_field :password, required: true, class: 'form-control'
- .form-group
- = f.label :password_confirmation, class: 'control-label'
- .col-sm-10
- = f.password_field :password_confirmation, required: true, class: 'form-control'
- .form-actions
- = f.submit 'Save password', class: "btn btn-create"
diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml
deleted file mode 100644
index 8bed6e0dbee1f4fcd1e21fd1c3a654a5402324e5..0000000000000000000000000000000000000000
--- a/app/views/profiles/passwords/new.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-%h3.page-title Setup new password
-%hr
-= form_for @user, url: profile_password_path, method: :post, html: { class: 'form-horizontal '} do |f|
- %p.slead
- Please set a new password before proceeding.
- %br
- After a successful password update you will be redirected to login screen.
- -if @user.errors.any?
- .alert.alert-danger
- %ul
- - @user.errors.full_messages.each do |msg|
- %li= msg
-
- - unless @user.password_automatically_set?
- .form-group
- = f.label :current_password, class: 'control-label'
- .col-sm-10= f.password_field :current_password, required: true, class: 'form-control'
- .form-group
- = f.label :password, class: 'control-label'
- .col-sm-10= f.password_field :password, required: true, class: 'form-control'
- .form-group
- = f.label :password_confirmation, class: 'control-label'
- .col-sm-10
- = f.password_field :password_confirmation, required: true, class: 'form-control'
- .form-actions
- = f.submit 'Set new password', class: "btn btn-create"
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
deleted file mode 100644
index 6c745e69e4061fe83bd5a5393dc7bfc2ee57b93e..0000000000000000000000000000000000000000
--- a/app/views/profiles/show.html.haml
+++ /dev/null
@@ -1,110 +0,0 @@
-%h3.page-title
- Profile Settings
-%p.light
- This information will appear on your profile.
- - if current_user.ldap_user?
- Some options are unavailable for LDAP accounts
-%hr
-
-
-
-= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit_user form-horizontal" }, authenticity_token: true do |f|
- -if @user.errors.any?
- %div.alert.alert-danger
- %ul
- - @user.errors.full_messages.each do |msg|
- %li= msg
- .row
- .col-md-7
- .form-group
- = f.label :name, class: "control-label"
- .col-sm-10
- = f.text_field :name, class: "form-control", required: true
- %span.help-block Enter your name, so people you know can recognize you.
-
- .form-group
- = f.label :email, class: "control-label"
- .col-sm-10
- - if @user.ldap_user?
- = f.text_field :email, class: "form-control", required: true, readonly: true
- %span.help-block.light
- Email is read-only for LDAP user
- - else
- - if @user.temp_oauth_email?
- = f.text_field :email, class: "form-control", required: true, value: nil
- - else
- = f.text_field :email, class: "form-control", required: true
- - if @user.unconfirmed_email.present?
- %span.help-block
- Please click the link in the confirmation email before continuing, it was sent to
- %strong #{@user.unconfirmed_email}
-
- - else
- %span.help-block We also use email for avatar detection if no avatar is uploaded.
- .form-group
- = f.label :public_email, class: "control-label"
- .col-sm-10
- = f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), {include_blank: 'Do not show in profile'}, class: "form-control"
- %span.help-block This email will be displayed on your public profile.
- .form-group
- = f.label :skype, class: "control-label"
- .col-sm-10= f.text_field :skype, class: "form-control"
- .form-group
- = f.label :linkedin, class: "control-label"
- .col-sm-10= f.text_field :linkedin, class: "form-control"
- .form-group
- = f.label :twitter, class: "control-label"
- .col-sm-10= f.text_field :twitter, class: "form-control"
- .form-group
- = f.label :website_url, 'Website', class: "control-label"
- .col-sm-10= f.text_field :website_url, class: "form-control"
- .form-group
- = f.label :location, 'Location', class: "control-label"
- .col-sm-10= f.text_field :location, class: "form-control"
- .form-group
- = f.label :bio, class: "control-label"
- .col-sm-10
- = f.text_area :bio, rows: 4, class: "form-control", maxlength: 250
- %span.help-block Tell us about yourself in fewer than 250 characters.
-
- .col-md-5
- .light-well
- = image_tag avatar_icon(@user.email, 160), alt: '', class: 'avatar s160'
-
- .clearfix
- .profile-avatar-form-option
- %p.light
- - if @user.avatar?
- You can change your avatar here
- - if Gitlab.config.gravatar.enabled
- %br
- or remove the current avatar to revert to #{link_to "gravatar.com", "http://gravatar.com"}
- - else
- You can upload an avatar here
- - if Gitlab.config.gravatar.enabled
- %br
- or change it at #{link_to "gravatar.com", "http://gravatar.com"}
- %hr
- %a.choose-btn.btn.btn-sm.js-choose-user-avatar-button
- %i.fa.fa-paperclip
- %span Choose File ...
-
- %span.file_name.js-avatar-filename File name...
- = f.file_field :avatar, class: "js-user-avatar-input hidden"
- .light The maximum file size allowed is 200KB.
- - if @user.avatar?
- %hr
- = link_to 'Remove avatar', profile_avatar_path, data: { confirm: "Avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
-
- - if @user.public_profile?
- .alert.alert-info
- %h4 Public profile
- %p Your profile is publicly visible because you joined public project(s)
-
-
- .row
- .col-md-7
- .form-group
- .col-sm-2
- .col-sm-10
- = f.submit 'Save changes', class: "btn btn-success"
diff --git a/app/views/profiles/update.js.erb b/app/views/profiles/update.js.erb
deleted file mode 100644
index e664ac2a52ab81cd0cb1f128664ff86909bb8ab3..0000000000000000000000000000000000000000
--- a/app/views/profiles/update.js.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-// Remove body class for any previous theme, re-add current one
-$('body').removeClass('ui_basic ui_mars ui_modern ui_gray ui_color light_theme dark_theme')
-$('body').addClass('<%= app_theme %> <%= theme_type %>')
-
-// Re-render the header to reflect the new theme
-$('header').html('<%= escape_javascript(render("layouts/head_panel", title: "Profile")) %>')
-
-// Re-initialize header tooltips
-$('.has_bottom_tooltip').tooltip({placement: 'bottom'})
diff --git a/app/views/profiles/update_username.js.haml b/app/views/profiles/update_username.js.haml
deleted file mode 100644
index 249680bcab6634f7dfd9d7806058053a1a91c9c9..0000000000000000000000000000000000000000
--- a/app/views/profiles/update_username.js.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-- if @user.valid?
- :plain
- new Flash("Username sucessfully changed", "notice")
-- else
- :plain
- new Flash("Username change failed - #{@user.errors.full_messages.first}", "alert")
diff --git a/app/views/projects/_bitbucket_import_modal.html.haml b/app/views/projects/_bitbucket_import_modal.html.haml
deleted file mode 100644
index 07d4d602769b7d07fdd6f5968f3e93c9c6990cd2..0000000000000000000000000000000000000000
--- a/app/views/projects/_bitbucket_import_modal.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%div#bitbucket_import_modal.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3 Import projects from Bitbucket
- .modal-body
- To enable importing projects from Bitbucket,
- - if current_user.admin?
- you need to
- - else
- your GitLab administrator needs to
- == #{link_to 'setup OAuth integration', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/bitbucket.md'}.
diff --git a/app/views/projects/_commit_button.html.haml b/app/views/projects/_commit_button.html.haml
deleted file mode 100644
index 35f7e7bb34bcfc190ca41af464136482bba56ebd..0000000000000000000000000000000000000000
--- a/app/views/projects/_commit_button.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.form-actions
- .commit-button-annotation
- = button_tag 'Commit Changes',
- class: 'btn commit-btn js-commit-button btn-create'
- = link_to 'Cancel', cancel_path,
- class: 'btn btn-cancel', data: {confirm: leave_edit_message}
diff --git a/app/views/projects/_dropdown.html.haml b/app/views/projects/_dropdown.html.haml
deleted file mode 100644
index 3036f11bb2df15e4ace806b4da29d6d481b30ee7..0000000000000000000000000000000000000000
--- a/app/views/projects/_dropdown.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-- if current_user
- .dropdown.pull-right
- %a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"}
- %i.fa.fa-bars
- %ul.dropdown-menu
- - if @project.issues_enabled && can?(current_user, :write_issue, @project)
- %li
- = link_to url_for_new_issue(@project, only_path: true), title: "New Issue" do
- %i.fa.fa-fw.fa-exclamation-circle
- New issue
- - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
- %li
- = link_to new_namespace_project_merge_request_path(@project.namespace, @project), title: "New Merge Request" do
- %i.fa.fa-fw.fa-tasks
- New merge request
- - if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
- %li
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do
- %i.fa.fa-fw.fa-file-text-o
- New snippet
- - if can?(current_user, :admin_project_member, @project)
- %li
- = link_to namespace_project_project_members_path(@project.namespace, @project), title: "New project member" do
- %i.fa.fa-fw.fa-users
- New project member
- - if can? current_user, :push_code, @project
- %li.divider
- %li
- = link_to new_namespace_project_branch_path(@project.namespace, @project) do
- %i.fa.fa-fw.fa-code-fork
- New branch
- %li
- = link_to new_namespace_project_tag_path(@project.namespace, @project) do
- %i.fa.fa-fw.fa-tag
- New tag
-
-
diff --git a/app/views/projects/_errors.html.haml b/app/views/projects/_errors.html.haml
deleted file mode 100644
index 7c8bb33ed7edc4f3d868742ec68f1a16005d3aab..0000000000000000000000000000000000000000
--- a/app/views/projects/_errors.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- if @project.errors.any?
- .alert.alert-danger
- %button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
- = @project.errors.full_messages.first
diff --git a/app/views/projects/_github_import_modal.html.haml b/app/views/projects/_github_import_modal.html.haml
deleted file mode 100644
index e88a0f7d6899263da37682cf0625f9cc8c9fa31a..0000000000000000000000000000000000000000
--- a/app/views/projects/_github_import_modal.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%div#github_import_modal.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3 Import projects from GitHub
- .modal-body
- To enable importing projects from GitHub,
- - if current_user.admin?
- you need to
- - else
- your GitLab administrator needs to
- == #{link_to 'setup OAuth integration', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/github.md'}.
\ No newline at end of file
diff --git a/app/views/projects/_gitlab_import_modal.html.haml b/app/views/projects/_gitlab_import_modal.html.haml
deleted file mode 100644
index 52212b6ae025f12132985f407da71caf2ce9936e..0000000000000000000000000000000000000000
--- a/app/views/projects/_gitlab_import_modal.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%div#gitlab_import_modal.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3 Import projects from GitLab.com
- .modal-body
- To enable importing projects from GitLab.com,
- - if current_user.admin?
- you need to
- - else
- your GitLab administrator needs to
- == #{link_to 'setup OAuth integration', 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/integration/gitlab.md'}.
\ No newline at end of file
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
deleted file mode 100644
index 5689bdee1c69e6b408e3ff2a622b5281a67809d0..0000000000000000000000000000000000000000
--- a/app/views/projects/_home_panel.html.haml
+++ /dev/null
@@ -1,43 +0,0 @@
-- empty_repo = @project.empty_repo?
-.project-home-panel{:class => ("empty-project" if empty_repo)}
- .project-identicon-holder
- = project_icon(@project, alt: '', class: 'avatar project-avatar')
- .project-home-row.project-home-row-top
- .project-home-desc
- - if @project.description.present?
- = escaped_autolink(@project.description)
- - if can?(current_user, :admin_project, @project)
- –
- = link_to 'Edit', edit_namespace_project_path
- - elsif !@project.empty_repo? && @repository.readme
- - readme = @repository.readme
- –
- = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do
- = readme.name
- .project-repo-buttons
- .inline.star.js-toggler-container{class: @show_star ? 'on' : ''}
- - if current_user
- = link_to_toggle_star('Star this project.', false)
- = link_to_toggle_star('Unstar this project.', true)
- - else
- = link_to new_user_session_path, class: 'btn star-btn has_tooltip', title: 'You must sign in to star a project' do
- %span
- = icon('star')
- Star
- %span.count
- = @project.star_count
- - unless @project.empty_repo?
- - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
- .inline.fork-buttons.prepend-left-10
- - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
- = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-sm btn-default' do
- = link_to_toggle_fork
- - else
- = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-sm btn-default' do
- = link_to_toggle_fork
-
- .project-home-row.hidden-xs
- - if current_user && !empty_repo
- .project-home-dropdown
- = render "dropdown"
- = render "shared/clone_panel"
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
deleted file mode 100644
index e321a84974ecf0985c17e2b24e17cdf36088ae47..0000000000000000000000000000000000000000
--- a/app/views/projects/_issuable_form.html.haml
+++ /dev/null
@@ -1,87 +0,0 @@
-- if issuable.errors.any?
- .row
- .col-sm-10.col-sm-offset-2
- .alert.alert-danger
- - issuable.errors.full_messages.each do |msg|
- %span= msg
- %br
-.form-group
- = f.label :title, class: 'control-label' do
- %strong= 'Title *'
- .col-sm-10
- = f.text_field :title, maxlength: 255, autofocus: true,
- class: 'form-control pad js-gfm-input', required: true
-.form-group.issuable-description
- = f.label :description, 'Description', class: 'control-label'
- .col-sm-10
-
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
- = render 'projects/zen', f: f, attr: :description,
- classes: 'description form-control'
- .col-sm-12.hint
- .pull-left
- Parsed with
- #{link_to 'GitLab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
- .pull-right
- Attach files by dragging & dropping
- or #{link_to 'selecting them', '#', class: 'markdown-selector' }.
-
- .clearfix
- .error-alert
-%hr
-.form-group
- .issue-assignee
- = f.label :assignee_id, class: 'control-label' do
- %i.fa.fa-user
- Assign to
- .col-sm-10
- = users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
- placeholder: 'Select a user', class: 'custom-form-control', null_user: true,
- selected: issuable.assignee_id)
-
- = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
-.form-group
- .issue-milestone
- = f.label :milestone_id, class: 'control-label' do
- %i.fa.fa-clock-o
- Milestone
- .col-sm-10
- - if milestone_options(issuable).present?
- = f.select(:milestone_id, milestone_options(issuable),
- { include_blank: 'Select milestone' }, { class: 'select2' })
- - else
- .prepend-top-10
- %span.light No open milestones available.
-
- - if can? current_user, :admin_milestone, issuable.project
- = link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
-.form-group
- = f.label :label_ids, class: 'control-label' do
- %i.fa.fa-tag
- Labels
- .col-sm-10
- - if issuable.project.labels.any?
- = f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
- { selected: issuable.label_ids }, multiple: true, class: 'select2'
- - else
- .prepend-top-10
- %span.light No labels yet.
-
- - if can? current_user, :admin_label, issuable.project
- = link_to 'Create new label', new_namespace_project_label_path(issuable.project.namespace, issuable.project), target: :blank
-
-.form-actions
- - if !issuable.project.empty_repo? && (guide_url = contribution_guide_url(issuable.project)) && !issuable.persisted?
- %p
- Please review the
- %strong #{link_to 'guidelines for contribution', guide_url}
- to this repository.
- - if issuable.new_record?
- = f.submit "Submit new #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
- - else
- = f.submit 'Save changes', class: 'btn btn-save'
- - if issuable.new_record?
- - cancel_project = issuable.source_project
- - else
- - cancel_project = issuable.project
- = link_to 'Cancel', [cancel_project.namespace.becomes(Namespace), cancel_project, issuable], class: 'btn btn-cancel'
diff --git a/app/views/projects/_md_preview.html.haml b/app/views/projects/_md_preview.html.haml
deleted file mode 100644
index f356a25dbfa23738996debf3fca8d7c94acd4511..0000000000000000000000000000000000000000
--- a/app/views/projects/_md_preview.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%ul.nav.nav-tabs
- %li.active
- = link_to '#md-write-holder', class: 'js-md-write-button' do
- Write
- %li
- = link_to '#md-preview-holder', class: 'js-md-preview-button',
- data: { url: markdown_preview_namespace_project_path(@project.namespace, @project) } do
- Preview
-%div
- .md-write-holder
- = yield
- .md-preview-holder.hide
- .js-md-preview{class: (preview_class if defined?(preview_class))}
diff --git a/app/views/projects/_settings_nav.html.haml b/app/views/projects/_settings_nav.html.haml
deleted file mode 100644
index 281a84a3d3c84ddc77a0ec4a8249883eba47a64e..0000000000000000000000000000000000000000
--- a/app/views/projects/_settings_nav.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-%ul.project-settings-nav.sidebar-subnav
- = nav_link(path: 'projects#edit') do
- = link_to edit_project_path(@project), title: 'Project', class: "stat-tab tab " do
- %i.fa.fa-pencil-square-o
- %span
- Project
- = nav_link(controller: [:project_members, :teams]) do
- = link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: "team-tab tab" do
- %i.fa.fa-users
- %span
- Members
- = nav_link(controller: :deploy_keys) do
- = link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys' do
- %i.fa.fa-key
- %span
- Deploy Keys
- = nav_link(controller: :hooks) do
- = link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks' do
- %i.fa.fa-link
- %span
- Web Hooks
- = nav_link(controller: :services) do
- = link_to namespace_project_services_path(@project.namespace, @project), title: 'Services' do
- %i.fa.fa-cogs
- %span
- Services
- = nav_link(controller: :protected_branches) do
- = link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches' do
- %i.fa.fa-lock
- %span
- Protected branches
diff --git a/app/views/projects/_visibility_level.html.haml b/app/views/projects/_visibility_level.html.haml
deleted file mode 100644
index 42c8e685224c022894f724ce9140d50d6be4273e..0000000000000000000000000000000000000000
--- a/app/views/projects/_visibility_level.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-.form-group.project-visibility-level-holder
- = f.label :visibility_level, class: 'control-label' do
- Visibility Level
- = link_to "(?)", help_page_path("public_access", "public_access")
- .col-sm-10
- - if can_change_visibility_level
- - Gitlab::VisibilityLevel.values.each do |level|
- .radio
- - restricted = restricted_visibility_levels.include?(level)
- = label :project_visibility_level, level do
- = f.radio_button :visibility_level, level, checked: (visibility_level == level), disabled: restricted
- = visibility_level_icon(level)
- .option-title
- = visibility_level_label(level)
- .option-descr
- = visibility_level_description(level)
- - unless restricted_visibility_levels.empty?
- .col-sm-10
- %span.info
- Some visibility level settings have been restricted by the administrator.
- - else
- .col-sm-10
- %span.info
- = visibility_level_icon(visibility_level)
- %strong
- = visibility_level_label(visibility_level)
- .light= visibility_level_description(visibility_level)
diff --git a/app/views/projects/_zen.html.haml b/app/views/projects/_zen.html.haml
deleted file mode 100644
index cf1c55ecca6535a3f1b6ec4a172e793dfb6c8b2a..0000000000000000000000000000000000000000
--- a/app/views/projects/_zen.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-.zennable
- %input#zen-toggle-comment.zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
- .zen-backdrop
- - classes << ' js-gfm-input markdown-area'
- = f.text_area attr, class: classes, placeholder: 'Leave a comment'
- = link_to nil, class: 'zen-enter-link', tabindex: '-1' do
- %i.fa.fa-expand
- Edit in fullscreen
- = link_to nil, class: 'zen-leave-link' do
- %i.fa.fa-compress
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
deleted file mode 100644
index e6a859fea8fbe96445adf1327777199c9c570c1f..0000000000000000000000000000000000000000
--- a/app/views/projects/blame/show.html.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-%h3.page-title Blame view
-
-#tree-holder.tree-holder
- .file-holder
- .file-title
- %i.fa.fa-file
- %strong
- = @path
- %small= number_to_human_size @blob.size
- .file-actions
- = render "projects/blob/actions"
- .file-content.blame.highlight
- %table
- - @blame.each do |commit, lines, since|
- - commit = Commit.new(commit)
- %tr
- %td.blame-commit
- %span.commit
- = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit_short_id"
-
- = commit_author_link(commit, avatar: true, size: 16)
-
- = link_to_gfm truncate(commit.title, length: 20), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "row_title"
- %td.lines.blame-numbers
- %pre
- - (since...(since + lines.count)).each do |i|
- = i
- \
- %td.lines
- %pre{class: 'code highlight white'}
- %code
- :erb
- <% lines.each do |line| %>
- <%= highlight(@blob.name, line, true).html_safe %>
- <% end %>
diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml
deleted file mode 100644
index 13f8271b979c080a5fe28bb79c41c8aaf1cff818..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_actions.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-.btn-group.tree-btn-group
- = edit_blob_link(@project, @ref, @path)
- = link_to 'Raw', namespace_project_raw_path(@project.namespace, @project, @id),
- class: 'btn btn-sm', target: '_blank'
- -# only show normal/blame view links for text files
- - if @blob.text?
- - if current_page? namespace_project_blame_path(@project.namespace, @project, @id)
- = link_to 'Normal View', namespace_project_blob_path(@project.namespace, @project, @id),
- class: 'btn btn-sm'
- - else
- = link_to 'Blame', namespace_project_blame_path(@project.namespace, @project, @id),
- class: 'btn btn-sm' unless @blob.empty?
- = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id),
- class: 'btn btn-sm'
- - if @ref != @commit.sha
- = link_to 'Permalink', namespace_project_blob_path(@project.namespace, @project,
- tree_join(@commit.sha, @path)), class: 'btn btn-sm'
-
-- if allowed_tree_edit?
- = button_tag class: 'remove-blob btn btn-sm btn-remove',
- 'data-toggle' => 'modal', 'data-target' => '#modal-remove-blob' do
- Remove
diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml
deleted file mode 100644
index 65c3ab10e0215ef997ff9740fd92fe97a0f6643d..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_blob.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-%ul.breadcrumb.repo-breadcrumb
- %li
- %i.fa.fa-angle-right
- = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
- = @project.path
- - tree_breadcrumbs(@tree, 6) do |title, path|
- %li
- - if path
- - if path.end_with?(@path)
- = link_to namespace_project_blob_path(@project.namespace, @project, path) do
- %strong
- = truncate(title, length: 40)
- - else
- = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
- - else
- = link_to title, '#'
-
-%ul.blob-commit-info.well.hidden-xs
- - blob_commit = @repository.last_commit_for_path(@commit.id, blob.path)
- = render blob_commit, project: @project
-
-%div#tree-content-holder.tree-content-holder
- %article.file-holder
- .file-title
- = blob_icon blob.mode, blob.name
- %strong
- = blob.name
- %small
- = number_to_human_size(blob.size)
- .file-actions.hidden-xs
- = render "actions"
- - if blob.text?
- = render "text", blob: blob
- - elsif blob.image?
- = render "image", blob: blob
- - else
- = render "download", blob: blob
diff --git a/app/views/projects/blob/_download.html.haml b/app/views/projects/blob/_download.html.haml
deleted file mode 100644
index f2c5e95ecf4252d8612c8399d1ff2525b2e4907c..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_download.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-.file-content.blob_file.blob-no-preview
- .center
- = link_to namespace_project_raw_path(@project.namespace, @project, @id) do
- %h1.light
- %i.fa.fa-download
- %h4
- Download (#{number_to_human_size blob.size})
diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml
deleted file mode 100644
index 96f188e4aa7ab644487318d53faf2a021a4053b7..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_editor.html.haml
+++ /dev/null
@@ -1,25 +0,0 @@
-.file-holder.file
- .file-title
- .editor-ref
- %i.fa.fa-code-fork
- = ref
- %span.editor-file-name
- - if @path
- %span.monospace
- = @path
-
- - if current_action?(:new) || current_action?(:create)
- \/
- = text_field_tag 'file_name', params[:file_name], placeholder: "File name",
- required: true, class: 'form-control new-file-name'
- .pull-right
- = select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'form-control'
-
- .file-content.code
- %pre.js-edit-mode-pane#editor
- = params[:content] || local_assigns[:blob_data]
- - if local_assigns[:path]
- .js-edit-mode-pane#preview.hide
- .center
- %h2
- %i.icon-spinner.icon-spin
diff --git a/app/views/projects/blob/_image.html.haml b/app/views/projects/blob/_image.html.haml
deleted file mode 100644
index c090f690d1d7d90602112e28447a736f1ea5f8f6..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_image.html.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-.file-content.image_file
- %img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}"}
diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml
deleted file mode 100644
index 09559a4967b929b0a0a8c61754587dc6bf26c6e6..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_remove.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-#modal-remove-blob.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3.page-title Remove #{@blob.name}
- %p.light
- From branch
- %strong= @ref
-
- .modal-body
- = form_tag namespace_project_blob_path(@project.namespace, @project, @id), method: :delete, class: 'form-horizontal' do
- = render 'shared/commit_message_container', params: params,
- placeholder: 'Removed this file because...'
- .form-group
- .col-sm-2
- .col-sm-10
- = button_tag 'Remove file', class: 'btn btn-remove btn-remove-file'
- = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"
-
-:javascript
- disableButtonIfEmptyField('#commit_message', '.btn-remove-file')
diff --git a/app/views/projects/blob/_text.html.haml b/app/views/projects/blob/_text.html.haml
deleted file mode 100644
index f6bd62f239baab71521db45ea9131ac41c99a4bc..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/_text.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- if gitlab_markdown?(blob.name)
- .file-content.wiki
- = preserve do
- = markdown(blob.data)
-- elsif markup?(blob.name)
- .file-content.wiki
- = render_markup(blob.name, blob.data)
-- else
- .file-content.code
- - unless blob.empty?
- = render 'shared/file_highlight', blob: blob
- - else
- .nothing-here-block Empty file
diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml
deleted file mode 100644
index 5c79d0ef11f75e941b165b3a18c099fb401d5352..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/diff.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-- if @lines.present?
- - if @form.unfold? && @form.since != 1 && !@form.bottom?
- %tr.line_holder{ id: @form.since }
- = render "projects/diffs/match_line", {line: @match_line,
- line_old: @form.since, line_new: @form.since, bottom: false}
-
- - @lines.each_with_index do |line, index|
- - line_new = index + @form.since
- - line_old = line_new - @form.offset
- %tr.line_holder
- %td.old_line.diff-line-num{data: {linenumber: line_old}}
- = link_to raw(line_old), "#"
- %td.new_line= link_to raw(line_new) , "#"
- %td.line_content.noteable_line= line
-
- - if @form.unfold? && @form.bottom? && @form.to < @blob.loc
- %tr.line_holder{ id: @form.to }
- = render "projects/diffs/match_line", {line: @match_line,
- line_old: @form.to, line_new: @form.to, bottom: true}
diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml
deleted file mode 100644
index 1f61a0b940c84b940e1517111b65e67180c8d889..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/edit.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-.file-editor
- %ul.nav.nav-tabs.js-edit-mode
- %li.active
- = link_to '#editor' do
- %i.fa.fa-edit
- Edit file
-
- %li
- = link_to '#preview', 'data-preview-url' => namespace_project_preview_blob_path(@project.namespace, @project, @id) do
- %i.fa.fa-eye
- = editing_preview_title(@blob.name)
-
- = form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: "form-horizontal") do
- = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data
- = render 'shared/commit_message_container', params: params,
- placeholder: "Update #{@blob.name}"
-
- .form-group.branch
- = label_tag 'branch', class: 'control-label' do
- Branch
- .col-sm-10
- = text_field_tag 'new_branch', @ref, class: "form-control"
-
- = hidden_field_tag 'last_commit', @last_commit
- = hidden_field_tag 'content', '', id: "file-content"
- = hidden_field_tag 'from_merge_request_id', params[:from_merge_request_id]
- = render 'projects/commit_button', ref: @ref,
- cancel_path: @after_edit_path
-
-:javascript
- blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml
deleted file mode 100644
index d78a01f6422ceed88b7dbdd057a297499adb1ff4..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/new.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-%h3.page-title New file
-.file-editor
- = form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file') do
- = render 'projects/blob/editor', ref: @ref
- = render 'shared/commit_message_container', params: params,
- placeholder: 'Add new file'
-
- .form-group.branch
- = label_tag 'branch', class: 'control-label' do
- Branch
- .col-sm-10
- = text_field_tag 'new_branch', @ref, class: "form-control"
-
- = hidden_field_tag 'content', '', id: 'file-content'
- = render 'projects/commit_button', ref: @ref,
- cancel_path: namespace_project_tree_path(@project.namespace, @project, @id)
-
-:javascript
- blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
diff --git a/app/views/projects/blob/preview.html.haml b/app/views/projects/blob/preview.html.haml
deleted file mode 100644
index e7c3460ad7852ec49bfe84f0e0af009ec2634bd3..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/preview.html.haml
+++ /dev/null
@@ -1,25 +0,0 @@
-.diff-file
- .diff-content
- - if gitlab_markdown?(@blob.name)
- .file-content.wiki
- = preserve do
- = markdown(@content)
- - elsif markup?(@blob.name)
- .file-content.wiki
- = raw render_markup(@blob.name, @content)
- - else
- .file-content.code
- - unless @diff_lines.empty?
- %table.text-file
- - @diff_lines.each do |line|
- %tr.line_holder{ class: "#{line.type}" }
- - if line.type == "match"
- %td.old_line= "..."
- %td.new_line= "..."
- %td.line_content.matched= line.text
- - else
- %td.old_line
- %td.new_line
- %td.line_content{class: "#{line.type}"}= raw diff_line_content(line.text)
- - else
- .nothing-here-block No changes.
diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml
deleted file mode 100644
index 69167654c39d9fac445e6c80245c154fd1baa86f..0000000000000000000000000000000000000000
--- a/app/views/projects/blob/show.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%div.tree-ref-holder
- = render 'shared/ref_switcher', destination: 'blob', path: @path
-
-%div#tree-holder.tree-holder
- = render 'blob', blob: @blob
-
-- if allowed_tree_edit?
- = render 'projects/blob/remove'
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
deleted file mode 100644
index 4e7415be4aa25f417639b959b8236c4ce35a0c6c..0000000000000000000000000000000000000000
--- a/app/views/projects/branches/_branch.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-- commit = @repository.commit(branch.target)
-%li(class="js-branch-#{branch.name}")
- %h4
- = link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do
- %strong.str-truncated= branch.name
- - if branch.name == @repository.root_ref
- %span.label.label-info default
- - if @project.protected_branch? branch.name
- %span.label.label-success
- %i.fa.fa-lock
- protected
- .pull-right
- - if can?(current_user, :download_code, @project)
- = render 'projects/repositories/download_archive', ref: branch.name, btn_class: 'btn-grouped btn-group-xs'
- - if branch.name != @repository.root_ref
- = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: branch.name), class: 'btn btn-grouped btn-xs', method: :post, title: "Compare" do
- %i.fa.fa-files-o
- Compare
-
- - if can_remove_branch?(@project, branch.name)
- = link_to namespace_project_branch_path(@project.namespace, @project, branch.name), class: 'btn btn-grouped btn-xs btn-remove remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do
- %i.fa.fa-trash-o
-
- - if commit
- %ul.list-unstyled
- = render 'projects/commits/inline_commit', commit: commit, project: @project
- - else
- %p
- Cant find HEAD commit for this branch
diff --git a/app/views/projects/branches/destroy.js.haml b/app/views/projects/branches/destroy.js.haml
deleted file mode 100644
index 882a4d0c5e26672dd1f439814e0fce7c5c23dd27..0000000000000000000000000000000000000000
--- a/app/views/projects/branches/destroy.js.haml
+++ /dev/null
@@ -1 +0,0 @@
-$('.js-totalbranch-count').html("#{@repository.branches.size}")
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
deleted file mode 100644
index a313ffcf27294a07dc1e6024d5c2ac2077d4f6f6..0000000000000000000000000000000000000000
--- a/app/views/projects/branches/index.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-= render "projects/commits/head"
-%h3.page-title
- Branches
- .pull-right
- - if can? current_user, :push_code, @project
- = link_to new_namespace_project_branch_path(@project.namespace, @project), class: 'btn btn-create' do
- %i.fa.fa-add-sign
- New branch
-
- .dropdown.inline
- %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %span.light sort:
- - if @sort.present?
- = @sort.humanize
- - else
- Name
- %b.caret
- %ul.dropdown-menu
- %li
- = link_to namespace_project_branches_path(sort: nil) do
- Name
- = link_to namespace_project_branches_path(sort: 'recently_updated') do
- = sort_title_recently_updated
- = link_to namespace_project_branches_path(sort: 'last_updated') do
- = sort_title_oldest_updated
-%hr
-- unless @branches.empty?
- %ul.bordered-list.top-list.all-branches
- - @branches.each do |branch|
- = render "projects/branches/branch", branch: branch
- = paginate @branches, theme: 'gitlab'
diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml
deleted file mode 100644
index e5fcb98c68cb00d8f561619a77cfea206579c100..0000000000000000000000000000000000000000
--- a/app/views/projects/branches/new.html.haml
+++ /dev/null
@@ -1,28 +0,0 @@
-- if @error
- .alert.alert-danger
- %button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
- = @error
-%h3.page-title
- %i.fa.fa-code-fork
- New branch
-= form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "form-horizontal" do
- .form-group
- = label_tag :branch_name, 'Name for new branch', class: 'control-label'
- .col-sm-10
- = text_field_tag :branch_name, params[:branch_name], placeholder: 'enter new branch name', required: true, tabindex: 1, class: 'form-control'
- .form-group
- = label_tag :ref, 'Create from', class: 'control-label'
- .col-sm-10
- = text_field_tag :ref, params[:ref], placeholder: 'existing branch name, tag or commit SHA', required: true, tabindex: 2, class: 'form-control'
- .form-actions
- = button_tag 'Create branch', class: 'btn btn-create', tabindex: 3
- = link_to 'Cancel', namespace_project_branches_path(@project.namespace, @project), class: 'btn btn-cancel'
-
-:javascript
- disableButtonIfAnyEmptyField($("#new-branch-form"), ".form-control", ".btn-create");
- var availableTags = #{@project.repository.ref_names.to_json};
-
- $("#ref").autocomplete({
- source: availableTags,
- minLength: 1
- });
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
deleted file mode 100644
index 3f645b81397acc36b97a71a4d337f7b7cf564025..0000000000000000000000000000000000000000
--- a/app/views/projects/commit/_commit_box.html.haml
+++ /dev/null
@@ -1,52 +0,0 @@
-.pull-right
- %div
- - if @notes_count > 0
- %span.btn.disabled.btn-grouped
- %i.fa.fa-comment
- = @notes_count
- .pull-left.btn-group
- %a.btn.btn-grouped.dropdown-toggle{ data: {toggle: :dropdown} }
- %i.fa.fa-download
- Download as
- %span.caret
- %ul.dropdown-menu
- - unless @commit.parents.length > 1
- %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch)
- %li= link_to "Plain Diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff)
- = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-primary btn-grouped" do
- %span Browse Code »
- %div
-
-%p
- %span.light Commit
- = link_to @commit.id, namespace_project_commit_path(@project.namespace, @project, @commit)
-.commit-info-row
- %span.light Authored by
- %strong
- = commit_author_link(@commit, avatar: true, size: 24)
- #{time_ago_with_tooltip(@commit.authored_date)}
-
-- if @commit.different_committer?
- .commit-info-row
- %span.light Committed by
- %strong
- = commit_committer_link(@commit, avatar: true, size: 24)
- #{time_ago_with_tooltip(@commit.committed_date)}
-
-.commit-info-row
- %span.cgray= pluralize(@commit.parents.count, "parent")
- - @commit.parents.each do |parent|
- = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent)
-
-.commit-info-row.branches
- %i.fa.fa-spinner.fa-spin
-
-.commit-box
- %h3.commit-title
- = gfm escape_once(@commit.title)
- - if @commit.description.present?
- %pre.commit-description
- = preserve(gfm(escape_once(@commit.description)))
-
-:coffeescript
- $(".commit-info-row.branches").load("#{branches_namespace_project_commit_path(@project.namespace, @project, @commit.id)}")
diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml
deleted file mode 100644
index 82aac1fbd15e4424b7c7b7b6eeeaa8a366dd4b90..0000000000000000000000000000000000000000
--- a/app/views/projects/commit/branches.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-- if @branches.any?
- %span
- - branch = commit_default_branch(@project, @branches)
- = link_to(namespace_project_tree_path(@project.namespace, @project, branch)) do
- %span.label.label-gray
- %i.fa.fa-code-fork
- = branch
- - if @branches.any? || @tags.any?
- = link_to("#", class: "js-details-expand") do
- %span.label.label-gray
- \...
- %span.js-details-content.hide
- - if @branches.any?
- = commit_branches_links(@project, @branches)
- - if @tags.any?
- = commit_tags_links(@project, @tags)
diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml
deleted file mode 100644
index fc721067ed4d870da8deec7ea2466d67c089804e..0000000000000000000000000000000000000000
--- a/app/views/projects/commit/show.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-= render "commit_box"
-= render "projects/diffs/diffs", diffs: @diffs, project: @project
-= render "projects/notes/notes_with_form"
diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
deleted file mode 100644
index c6026f968045358927506784a4cb8bf0812f5ee4..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/_commit.html.haml
+++ /dev/null
@@ -1,33 +0,0 @@
-%li.commit.js-toggle-container
- .commit-row-title
- %strong.str-truncated
- = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
- - if commit.description?
- %a.text-expander.js-toggle-button ...
-
- .pull-right
- = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
-
- .notes_count
- - if @note_counts
- - note_count = @note_counts.fetch(commit.id, 0)
- - else
- - notes = project.notes.for_commit_id(commit.id)
- - note_count = notes.user.count
-
- - if note_count > 0
- %span.light
- %i.fa.fa-comments
- = note_count
-
- - if commit.description?
- .commit-row-description.js-toggle-content
- %pre
- = preserve(gfm(escape_once(commit.description)))
-
- .commit-row-info
- = commit_author_link(commit, avatar: true, size: 24)
- authored
- .committed_ago
- #{time_ago_with_tooltip(commit.committed_date)}
- = link_to_browse_code(project, commit)
diff --git a/app/views/projects/commits/_commit_list.html.haml b/app/views/projects/commits/_commit_list.html.haml
deleted file mode 100644
index 2ee7d73bd20950eb79eca087882a905d5b1e2540..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/_commit_list.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-%div.panel.panel-default
- .panel-heading
- Commits (#{@commits.count})
- - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- %ul.well-list
- - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
- = render "projects/commits/inline_commit", commit: commit, project: @project
- %li.warning-row.unstyled
- other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
- - else
- %ul.well-list= render Commit.decorate(@commits), project: @project
diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml
deleted file mode 100644
index 0cd9ce1f371dc0a69705db8e9696856618634fc9..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/_commits.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-- unless defined?(project)
- - project = @project
-
-- @commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits|
- .row.commits-row
- .col-md-2.hidden-xs.hidden-sm
- %h5.commits-row-date
- %i.fa.fa-calendar
- %span= day.stamp("28 Aug, 2010")
- .light
- = pluralize(commits.count, 'commit')
- .col-md-10.col-sm-12
- %ul.bordered-list
- = render commits, project: project
- %hr.lists-separator
diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml
deleted file mode 100644
index a714f5f79e0f602ffcfcc754bd61edf224bcfa62..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/_head.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-%ul.nav.nav-tabs
- = nav_link(controller: [:commit, :commits]) do
- = link_to namespace_project_commits_path(@project.namespace, @project, @repository.root_ref) do
- Commits
- %span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',')
- = nav_link(controller: :compare) do
- = link_to 'Compare', namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref)
-
- = nav_link(html_options: {class: branches_tab_class}) do
- = link_to namespace_project_branches_path(@project.namespace, @project) do
- Branches
- %span.badge.js-totalbranch-count= @repository.branches.size
-
- = nav_link(controller: :tags) do
- = link_to namespace_project_tags_path(@project.namespace, @project) do
- Tags
- %span.badge.js-totaltags-count= @repository.tags.length
diff --git a/app/views/projects/commits/_inline_commit.html.haml b/app/views/projects/commits/_inline_commit.html.haml
deleted file mode 100644
index c03bc3f9df9edea05d80acb1377ad88d7e363735..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/_inline_commit.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%li.commit.inline-commit
- .commit-row-title
- = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
-
- %span.str-truncated
- = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
- .pull-right
- #{time_ago_with_tooltip(commit.committed_date)}
diff --git a/app/views/projects/commits/show.atom.builder b/app/views/projects/commits/show.atom.builder
deleted file mode 100644
index 9211de72b1b49bad03734dc430e09337fdf488f5..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/show.atom.builder
+++ /dev/null
@@ -1,23 +0,0 @@
-xml.instruct!
-xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
- xml.title "Recent commits to #{@project.name}:#{@ref}"
- xml.link :href => namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom), :rel => "self", :type => "application/atom+xml"
- xml.link :href => namespace_project_commits_url(@project.namespace, @project, @ref), :rel => "alternate", :type => "text/html"
- xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
- xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any?
-
- @commits.each do |commit|
- xml.entry do
- xml.id namespace_project_commit_url(@project.namespace, @project, :id => commit.id)
- xml.link :href => namespace_project_commit_url(@project.namespace, @project, :id => commit.id)
- xml.title truncate(commit.title, :length => 80)
- xml.updated commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")
- xml.media :thumbnail, :width => "40", :height => "40", :url => avatar_icon(commit.author_email)
- xml.author do |author|
- xml.name commit.author_name
- xml.email commit.author_email
- end
- xml.summary gfm(commit.description)
- end
- end
-end
diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml
deleted file mode 100644
index 7ea855e1a4e7b863c1c14f6ba2735cf8d17f1fa0..0000000000000000000000000000000000000000
--- a/app/views/projects/commits/show.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-= render "head"
-
-.tree-ref-holder
- = render 'shared/ref_switcher', destination: 'commits'
-
-- if current_user && current_user.private_token
- .commits-feed-holder.hidden-xs.hidden-sm
- = link_to namespace_project_commits_path(@project.namespace, @project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed", class: 'btn' do
- %i.fa.fa-rss
- Commits feed
-
-%ul.breadcrumb.repo-breadcrumb
- = commits_breadcrumbs
-
-%div{id: dom_id(@project)}
- #commits-list= render "commits", project: @project
-.clear
-= spinner
-
-- if @commits.count == @limit
- :javascript
- CommitsList.init("#{@ref}", #{@limit});
-
diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml
deleted file mode 100644
index dfb1dded9eaf70e2c12b1a425c189fb39a9f9366..0000000000000000000000000000000000000000
--- a/app/views/projects/compare/_form.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-= form_tag namespace_project_compare_index_path(@project.namespace, @project), method: :post, class: 'form-inline' do
- .clearfix.append-bottom-20
- - if params[:to] && params[:from]
- = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
- .form-group
- .input-group.inline-input-group
- %span.input-group-addon from
- = text_field_tag :from, params[:from], class: "form-control"
- = "..."
- .form-group
- .input-group.inline-input-group
- %span.input-group-addon to
- = text_field_tag :to, params[:to], class: "form-control"
-
- = button_tag "Compare", class: "btn btn-create commits-compare-btn"
- - if compare_to_mr_button?
- = link_to compare_mr_path, class: 'prepend-left-10 btn' do
- %strong Make a merge request
-
-
-:javascript
- var availableTags = #{@project.repository.ref_names.to_json};
-
- $("#from, #to").autocomplete({
- source: availableTags,
- minLength: 1
- });
-
- disableButtonIfEmptyField('#to', '.commits-compare-btn');
diff --git a/app/views/projects/compare/index.html.haml b/app/views/projects/compare/index.html.haml
deleted file mode 100644
index 4745bfbeaaf061e5a1f896ed2864f0ac76b2be73..0000000000000000000000000000000000000000
--- a/app/views/projects/compare/index.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-= render "projects/commits/head"
-
-%h3.page-title
- Compare View
-%p.slead
- Compare branches, tags or commit ranges.
- %br
- Fill input field with commit id like
- %code.label-branch 4eedf23
- or branch/tag name like
- %code.label-branch master
- and press compare button for the commits list and a code diff.
- %br
- Changes are shown from the version in the first field to the version in the second field.
-
-= render "form"
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
deleted file mode 100644
index 214b5bd337b5cb007189d1c4434f735609ad1cb6..0000000000000000000000000000000000000000
--- a/app/views/projects/compare/show.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-= render "projects/commits/head"
-
-%h3.page-title
- Compare View
-
-= render "form"
-
-- if @commits.present?
- = render "projects/commits/commit_list"
- = render "projects/diffs/diffs", diffs: @diffs, project: @project
-- else
- .light-well
- .center
- %h4
- There isn't anything to compare.
- %p.slead
- - if params[:to] == params[:from]
- %span.label-branch #{params[:from]}
- and
- %span.label-branch #{params[:to]}
- are the same.
- - else
- You'll need to use different branch names to get a valid comparison.
diff --git a/app/views/projects/deploy_keys/_deploy_key.html.haml b/app/views/projects/deploy_keys/_deploy_key.html.haml
deleted file mode 100644
index c577dfa8d55993544975f0e602c137881e474116..0000000000000000000000000000000000000000
--- a/app/views/projects/deploy_keys/_deploy_key.html.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-%li
- .pull-right
- - if @available_keys.include?(deploy_key)
- = link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do
- %i.fa.fa-plus
- Enable
- - else
- - if deploy_key.destroyed_when_orphaned? && deploy_key.almost_orphaned?
- = link_to 'Remove', disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :put, class: "btn btn-remove delete-key btn-sm pull-right"
- - else
- = link_to disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-sm', method: :put do
- %i.fa.fa-power-off
- Disable
-
- - if project = project_for_deploy_key(deploy_key)
- = link_to namespace_project_deploy_key_path(project.namespace, project, deploy_key) do
- %i.fa.fa-key
- %strong= deploy_key.title
- - else
- %i.fa.fa-key
- %strong= deploy_key.title
-
-
- %p.light.prepend-top-10
- - if deploy_key.public?
- %span.label.label-info.deploy-project-label
- Public deploy key
-
- - deploy_key.projects.each do |project|
- - if can?(current_user, :read_project, project)
- %span.label.label-gray.deploy-project-label
- = link_to namespace_project_path(project.namespace, project) do
- = project.name_with_namespace
-
- %small.pull-right
- Created #{time_ago_with_tooltip(deploy_key.created_at)}
diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml
deleted file mode 100644
index 91675b3738ecb9f2d734c2dacd415713816ea5e9..0000000000000000000000000000000000000000
--- a/app/views/projects/deploy_keys/_form.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-%div
- = form_for [@project.namespace.becomes(Namespace), @project, @key], url: namespace_project_deploy_keys_path, html: { class: 'deploy-key-form form-horizontal' } do |f|
- -if @key.errors.any?
- .alert.alert-danger
- %ul
- - @key.errors.full_messages.each do |msg|
- %li= msg
-
- .form-group
- = f.label :title, class: "control-label"
- .col-sm-10= f.text_field :title, class: 'form-control'
- .form-group
- = f.label :key, class: "control-label"
- .col-sm-10
- %p.light
- Paste a machine public key here. Read more about how to generate it
- = link_to "here", help_page_path("ssh", "README")
- = f.text_area :key, class: "form-control thin_area", rows: 5
-
- .form-actions
- = f.submit 'Create', class: "btn-create btn"
- = link_to "Cancel", namespace_project_deploy_keys_path(@project.namespace, @project), class: "btn btn-cancel"
-
diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml
deleted file mode 100644
index 472a13a85242018cecb712a20c692fd00b23125c..0000000000000000000000000000000000000000
--- a/app/views/projects/deploy_keys/index.html.haml
+++ /dev/null
@@ -1,41 +0,0 @@
-%h3.page-title
- Deploy keys allow read-only access to the repository
-
- = link_to new_namespace_project_deploy_key_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Deploy Key" do
- %i.fa.fa-plus
- New Deploy Key
-
-%p.light
- Deploy keys can be used for CI, staging or production servers.
- You can create a deploy key or add an existing one
-
-%hr.clearfix
-
-.row
- .col-md-6.enabled-keys
- %h5
- %strong.cgreen Enabled deploy keys
- for this project
- %ul.bordered-list
- = render @enabled_keys
- - if @enabled_keys.blank?
- .light-well
- .nothing-here-block Create a #{link_to 'new deploy key', new_namespace_project_deploy_key_path(@project.namespace, @project)} or add an existing one
- .col-md-6.available-keys
- - # If there are available public deploy keys but no available project deploy keys, only public deploy keys are shown.
- - if @available_project_keys.any? || @available_public_keys.blank?
- %h5
- %strong Deploy keys
- from projects you have access to
- %ul.bordered-list
- = render @available_project_keys
- - if @available_project_keys.blank?
- .light-well
- .nothing-here-block Deploy keys from projects you have access to will be displayed here
-
- - if @available_public_keys.any?
- %h5
- %strong Public deploy keys
- available to any project
- %ul.bordered-list
- = render @available_public_keys
diff --git a/app/views/projects/deploy_keys/new.html.haml b/app/views/projects/deploy_keys/new.html.haml
deleted file mode 100644
index 186d6b58972f256ea8719302eb4f109e8a3748ca..0000000000000000000000000000000000000000
--- a/app/views/projects/deploy_keys/new.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title New Deploy key
-%hr
-
-= render 'form'
diff --git a/app/views/projects/deploy_keys/show.html.haml b/app/views/projects/deploy_keys/show.html.haml
deleted file mode 100644
index 405b5bcd0d3a81e8a6f7da5c10866bafd4408b6f..0000000000000000000000000000000000000000
--- a/app/views/projects/deploy_keys/show.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%h3.page-title
- Deploy key:
- = @key.title
- %small
- created on
- = @key.created_at.stamp("Aug 21, 2011")
-.back-link
- = link_to namespace_project_deploy_keys_path(@project.namespace, @project) do
- ← To keys list
-%hr
-%pre= @key.key
-.pull-right
- = link_to 'Remove', namespace_project_deploy_key_path(@project.namespace, @project, @key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn-remove btn delete-key"
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
deleted file mode 100644
index b49aee504fe936789a7b45d06c893a45f511dd0f..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_diffs.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-.prepend-top-20.append-bottom-20
- .pull-right
- .btn-group
- = inline_diff_btn
- = parallel_diff_btn
- = render 'projects/diffs/stats', diffs: diffs
-
-- if show_diff_size_warning?(diffs)
- = render 'projects/diffs/warning', diffs: diffs
-
-.files
- - safe_diff_files(diffs).each_with_index do |diff_file, index|
- = render 'projects/diffs/file', diff_file: diff_file, i: index, project: project
-
-- if @diff_timeout
- .alert.alert-danger
- %h4
- Failed to collect changes
- %p
- Maybe diff is really big and operation failed with timeout. Try to get diff locally
-
-:coffeescript
- $('.files .diff-header').stick_in_parent(offset_top: $('.navbar').height())
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
deleted file mode 100644
index 672a6635321926492dd492d42d4ba73f0475c5c4..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_file.html.haml
+++ /dev/null
@@ -1,50 +0,0 @@
-- blob = project.repository.blob_for_diff(@commit, diff_file.diff)
-- return unless blob
-- blob_diff_path = namespace_project_blob_diff_path(project.namespace, project, tree_join(@commit.id, diff_file.file_path))
-.diff-file{id: "diff-#{i}", data: {blob_diff_path: blob_diff_path }}
- .diff-header{id: "file-path-#{hexdigest(diff_file.new_path || diff_file.old_path)}"}
- - if diff_file.deleted_file
- %span="#{diff_file.old_path} deleted"
-
- .diff-btn-group
- - if @commit.parent_ids.present?
- = view_file_btn(@commit.parent_id, diff_file, project)
- - elsif diff_file.diff.submodule?
- - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path)
- = submodule_link(submodule_item, @commit.id)
- - else
- %span
- - if diff_file.renamed_file
- = "#{diff_file.old_path} renamed to #{diff_file.new_path}"
- - else
- = diff_file.new_path
- - if diff_file.mode_changed?
- %span.file-mode= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
-
- .diff-btn-group
- - if blob.text?
- = link_to '#', class: 'js-toggle-diff-comments btn btn-sm active has_tooltip', title: "Toggle comments for this file" do
- %i.fa.fa-comments
-
-
- - if @merge_request && @merge_request.source_project
- = edit_blob_link(@merge_request.source_project,
- @merge_request.source_branch, diff_file.new_path,
- after: ' ', from_merge_request_id: @merge_request.id)
-
- = view_file_btn(@commit.id, diff_file, project)
-
- .diff-content.diff-wrap-lines
- -# Skipp all non non-supported blobs
- - return unless blob.respond_to?('text?')
- - if blob.text?
- - if params[:view] == 'parallel'
- = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i
- - else
- = render "projects/diffs/text_file", diff_file: diff_file, index: i
- - elsif blob.image?
- - old_file = project.repository.prev_blob_for_diff(@commit, diff_file)
- = render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i
- - else
- .nothing-here-block No preview for this file type
-
diff --git a/app/views/projects/diffs/_image.html.haml b/app/views/projects/diffs/_image.html.haml
deleted file mode 100644
index 058b71b21f5173efd9c37bd02377dd691d5e7af4..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_image.html.haml
+++ /dev/null
@@ -1,64 +0,0 @@
-- diff = diff_file.diff
-- if diff.renamed_file || diff.new_file || diff.deleted_file
- .image
- %span.wrap
- .frame{class: image_diff_class(diff)}
- %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- %p.image-info= "#{number_to_human_size file.size}"
-- else
- .image
- %div.two-up.view
- %span.wrap
- .frame.deleted
- %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.parent_id, diff.old_path))}
- %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
- %p.image-info.hide
- %span.meta-filesize= "#{number_to_human_size old_file.size}"
- |
- %b W:
- %span.meta-width
- |
- %b H:
- %span.meta-height
- %span.wrap
- .frame.added
- %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.id, diff.new_path))}
- %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- %p.image-info.hide
- %span.meta-filesize= "#{number_to_human_size file.size}"
- |
- %b W:
- %span.meta-width
- |
- %b H:
- %span.meta-height
-
- %div.swipe.view.hide
- .swipe-frame
- .frame.deleted
- %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
- .swipe-wrap
- .frame.added
- %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- %span.swipe-bar
- %span.top-handle
- %span.bottom-handle
-
- %div.onion-skin.view.hide
- .onion-skin-frame
- .frame.deleted
- %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
- .frame.added
- %img{src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- .controls
- .transparent
- .drag-track
- .dragger{:style => "left: 0px;"}
- .opaque
-
-
- .view-modes.hide
- %ul.view-modes-menu
- %li.two-up{data: {mode: 'two-up'}} 2-up
- %li.swipe{data: {mode: 'swipe'}} Swipe
- %li.onion-skin{data: {mode: 'onion-skin'}} Onion skin
diff --git a/app/views/projects/diffs/_match_line.html.haml b/app/views/projects/diffs/_match_line.html.haml
deleted file mode 100644
index 4ebe3379733feaaa9fd6bbab6f0c21aa370f0058..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_match_line.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%td.old_line.diff-line-num.unfold.js-unfold{data: {linenumber: line_old},
- class: unfold_bottom_class(bottom)}
- \...
-%td.new_line.diff-line-num.unfold.js-unfold{data: {linenumber: line_new},
- class: unfold_bottom_class(bottom)}
- \...
-%td.line_content.matched= line
diff --git a/app/views/projects/diffs/_match_line_parallel.html.haml b/app/views/projects/diffs/_match_line_parallel.html.haml
deleted file mode 100644
index 815df16aa4ab92ed646ae99df498d78fed75a5b0..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_match_line_parallel.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%td.old_line
- %td.line_content.parallel.matched= line
-%td.new_line
- %td.line_content.parallel.matched= line
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
deleted file mode 100644
index 75f3a80f0d7f03be10d9a0a3e5fdf0f53aab4ab6..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ /dev/null
@@ -1,41 +0,0 @@
-/ Side-by-side diff view
-%div.text-file.diff-wrap-lines
- %table
- - parallel_diff(diff_file, index).each do |line|
- - type_left = line[0]
- - line_number_left = line[1]
- - line_content_left = line[2]
- - line_code_left = line[3]
- - type_right = line[4]
- - line_number_right = line[5]
- - line_content_right = line[6]
- - line_code_right = line[7]
-
- %tr.line_holder.parallel
- - if type_left == 'match'
- = render "projects/diffs/match_line_parallel", { line: line_content_left,
- line_old: line_number_left, line_new: line_number_right }
- - elsif type_left == 'old' || type_left.nil?
- %td.old_line{id: line_code_left, class: "#{type_left}"}
- = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
- %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw line_content_left
-
- - if type_right == 'new'
- - new_line_class = 'new'
- - new_line_code = line_code_right
- - else
- - new_line_class = nil
- - new_line_code = line_code_left
-
- %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }}
- = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code
- %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw line_content_right
-
- - if @reply_allowed
- - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
- - if comments_left.present? || comments_right.present?
- = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments_left, notes2: comments_right
-
-- if diff_file.diff.diff.blank? && diff_file.mode_changed?
- .file-mode-changed
- File mode changed
diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml
deleted file mode 100644
index 1625930615a000c8048f40278017fa5d9c1b0520..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_stats.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-.js-toggle-container
- .commit-stat-summary
- Showing
- = link_to '#', class: 'js-toggle-button' do
- %strong #{pluralize(diffs.count, "changed file")}
- - if current_controller?(:commit)
- - unless @commit.has_zero_stats?
- with
- %strong.cgreen #{@commit.stats.additions} additions
- and
- %strong.cred #{@commit.stats.deletions} deletions
- .file-stats.js-toggle-content.hide
- %ul.bordered-list
- - diffs.each_with_index do |diff, i|
- %li
- - if diff.deleted_file
- %span.deleted-file
- %a{href: "#diff-#{i}"}
- %i.fa.fa-minus
- = diff.old_path
- - elsif diff.renamed_file
- %span.renamed-file
- %a{href: "#diff-#{i}"}
- %i.fa.fa-minus
- = diff.old_path
- →
- = diff.new_path
- - elsif diff.new_file
- %span.new-file
- %a{href: "#diff-#{i}"}
- %i.fa.fa-plus
- = diff.new_path
- - else
- %span.edit-file
- %a{href: "#diff-#{i}"}
- %i.fa.fa-adjust
- = diff.new_path
-
diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml
deleted file mode 100644
index e6dfbfd651120b1ac2e3a653eb0de26324b40dc3..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_text_file.html.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-- too_big = diff_file.diff_lines.count > Commit::DIFF_SAFE_LINES
-- if too_big
- %a.supp_diff_link Changes suppressed. Click to show
-
-%table.text-file{class: "#{'hide' if too_big}"}
- - last_line = 0
- - diff_file.diff_lines.each_with_index do |line, index|
- - type = line.type
- - last_line = line.new_pos
- - line_code = generate_line_code(diff_file.file_path, line)
- - line_old = line.old_pos
- %tr.line_holder{ id: line_code, class: "#{type}" }
- - if type == "match"
- = render "projects/diffs/match_line", {line: line.text,
- line_old: line_old, line_new: line.new_pos, bottom: false}
- - else
- %td.old_line
- = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code
- - if @comments_allowed && can?(current_user, :write_note, @project)
- = link_to_new_diff_note(line_code)
- %td.new_line{data: {linenumber: line.new_pos}}
- = link_to raw(type == "old" ? " " : line.new_pos) , "##{line_code}", id: line_code
- %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text)
-
- - if @reply_allowed
- - comments = @line_notes.select { |n| n.line_code == line_code && n.active? }.sort_by(&:created_at)
- - unless comments.empty?
- = render "projects/notes/diff_notes_with_reply", notes: comments, line: line.text
-
- - if last_line > 0
- = render "projects/diffs/match_line", {line: "",
- line_old: last_line, line_new: last_line, bottom: true}
-
-- if diff_file.diff.blank? && diff_file.mode_changed?
- .file-mode-changed
- File mode changed
diff --git a/app/views/projects/diffs/_warning.html.haml b/app/views/projects/diffs/_warning.html.haml
deleted file mode 100644
index 47abbba2eb225940bdb849e2ce7605750089aa31..0000000000000000000000000000000000000000
--- a/app/views/projects/diffs/_warning.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.alert.alert-warning
- %h4
- Too many changes.
- .pull-right
- - unless diff_hard_limit_enabled?
- = link_to "Reload with full diff", url_for(params.merge(force_show_diff: true)), class: "btn btn-sm btn-warning"
-
- - if current_controller?(:commit) or current_controller?(:merge_requests)
- - if current_controller?(:commit)
- = link_to "Plain diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff), class: "btn btn-warning btn-sm"
- = link_to "Email patch", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch), class: "btn btn-warning btn-sm"
- - elsif @merge_request && @merge_request.persisted?
- = link_to "Plain diff", merge_request_path(@merge_request, format: :diff), class: "btn btn-warning btn-sm"
- = link_to "Email patch", merge_request_path(@merge_request, format: :patch), class: "btn btn-warning btn-sm"
- %p
- To preserve performance only
- %strong #{allowed_diff_size} of #{diffs.size}
- files are displayed.
-
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
deleted file mode 100644
index fbf04847e489f9ec8dcdcb5ffc3c1d0f7736aed5..0000000000000000000000000000000000000000
--- a/app/views/projects/edit.html.haml
+++ /dev/null
@@ -1,206 +0,0 @@
-.project-edit-container
- .project-edit-errors
- .project-edit-content
- %div
- %h3.page-title
- Project settings
- %hr
- .panel-body
- = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit_project form-horizontal" }, authenticity_token: true do |f|
-
- %fieldset
- .form-group.project_name_holder
- = f.label :name, class: 'control-label' do
- Project name
- .col-sm-10
- = f.text_field :name, placeholder: "Example Project", class: "form-control", id: "project_name_edit"
-
-
- .form-group
- = f.label :description, class: 'control-label' do
- Project description
- %span.light (optional)
- .col-sm-10
- = f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250
-
- - if @project.repository.exists? && @project.repository.branch_names.any?
- .form-group
- = f.label :default_branch, "Default Branch", class: 'control-label'
- .col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'select2 select-wide'})
-
-
- = render "visibility_level", f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can?(current_user, :change_visibility_level, @project)
-
- .form-group
- = f.label :tag_list, "Tags", class: 'control-label'
- .col-sm-10
- = f.text_field :tag_list, maxlength: 2000, class: "form-control"
- %p.help-block Separate tags with commas.
-
- %fieldset.features
- %legend
- Features:
- .form-group
- = f.label :issues_enabled, "Issues", class: 'control-label'
- .col-sm-10
- .checkbox
- = f.check_box :issues_enabled
- %span.descr Lightweight issue tracking system for this project
-
- .form-group
- = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label'
- .col-sm-10
- .checkbox
- = f.check_box :merge_requests_enabled
- %span.descr Submit changes to be merged upstream.
-
- .form-group
- = f.label :wiki_enabled, "Wiki", class: 'control-label'
- .col-sm-10
- .checkbox
- = f.check_box :wiki_enabled
- %span.descr Pages for project documentation
-
- .form-group
- = f.label :snippets_enabled, "Snippets", class: 'control-label'
- .col-sm-10
- .checkbox
- = f.check_box :snippets_enabled
- %span.descr Share code pastes with others out of git repository
-
- %fieldset.features
- %legend
- Project avatar:
- .form-group
- .col-sm-2
- .col-sm-10
- - if @project.avatar?
- = project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar s160')
- %p.light
- - if @project.avatar_in_git
- Project avatar in repository: #{ @project.avatar_in_git }
- %p.light
- - if @project.avatar?
- You can change your project avatar here
- - else
- You can upload a project avatar here
- %a.choose-btn.btn.btn-sm.js-choose-project-avatar-button
- %i.icon-paper-clip
- %span Choose File ...
-
- %span.file_name.js-avatar-filename File name...
- = f.file_field :avatar, class: "js-project-avatar-input hidden"
- .light The maximum file size allowed is 200KB.
- - if @project.avatar?
- %hr
- = link_to 'Remove avatar', namespace_project_avatar_path(@project.namespace, @project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
-
- .form-actions
- = f.submit 'Save changes', class: "btn btn-save"
-
-
-
- .danger-settings
- - if can? current_user, :archive_project, @project
- - if @project.archived?
- .panel.panel-success
- .panel-heading
- Unarchive project
- .panel-body
- %p
- Unarchiving the project will mark its repository as active.
- %br
- The project can be committed to.
- %br
- %strong Once active this project shows up in the search and on the dashboard.
- = link_to 'Unarchive', unarchive_namespace_project_path(@project.namespace, @project),
- data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be committed to again." },
- method: :post, class: "btn btn-success"
- - else
- .panel.panel-warning
- .panel-heading
- Archive project
- .panel-body
- %p
- Archiving the project will mark its repository as read-only.
- %br
- It is hidden from the dashboard and doesn't show up in searches.
- %br
- %strong Archived projects cannot be committed to!
- = link_to 'Archive', archive_namespace_project_path(@project.namespace, @project),
- data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
- method: :post, class: "btn btn-warning"
- - else
- .nothing-here-block Only the project owner can archive a project
-
- .panel.panel-default.panel.panel-warning
- .panel-heading Rename repository
- .errors-holder
- .panel-body
- = form_for([@project.namespace.becomes(Namespace), @project], html: { class: 'form-horizontal' }) do |f|
- .form-group.project_name_holder
- = f.label :name, class: 'control-label' do
- Project name
- .col-sm-9
- .form-group
- = f.text_field :name, placeholder: "Example Project", class: "form-control"
- .form-group
- = f.label :path, class: 'control-label' do
- %span Path
- .col-sm-9
- .form-group
- .input-group
- .input-group-addon
- #{URI.join(root_url, @project.namespace.path)}/
- = f.text_field :path, class: 'form-control'
- %span.input-group-addon .git
- %ul
- %li Be careful. Renaming a project's repository can have unintended side effects.
- %li You will need to update your local repositories to point to the new location.
- .form-actions
- = f.submit 'Rename', class: "btn btn-warning"
-
- - if can?(current_user, :change_namespace, @project)
- .panel.panel-default.panel.panel-danger
- .panel-heading Transfer project
- .errors-holder
- .panel-body
- = form_for([@project.namespace.becomes(Namespace), @project], url: transfer_namespace_project_path(@project.namespace, @project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
- .form-group
- = label_tag :new_namespace_id, nil, class: 'control-label' do
- %span Namespace
- .col-sm-10
- .form-group
- = select_tag :new_namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace', class: 'select2' }
- %ul
- %li Be careful. Changing the project's namespace can have unintended side effects.
- %li You can only transfer the project to namespaces you manage.
- %li You will need to update your local repositories to point to the new location.
- .form-actions
- = f.submit 'Transfer', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) }
- - else
- .nothing-here-block Only the project owner can transfer a project
-
- - if can?(current_user, :remove_project, @project)
- .panel.panel-default.panel.panel-danger
- .panel-heading Remove project
- .panel-body
- = form_tag(namespace_project_path(@project.namespace, @project), method: :delete, html: { class: 'form-horizontal'}) do
- %p
- Removing the project will delete its repository and all related resources including issues, merge requests etc.
- %br
- %strong Removed projects cannot be restored!
-
- = link_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
- - else
- .nothing-here-block Only project owner can remove a project
-
-.save-project-loader.hide
- .center
- %h2
- %i.fa.fa-spinner.fa-spin
- Saving project.
- %p Please wait a moment, this page will automatically refresh when ready.
-
-
-= render 'shared/confirm_modal', phrase: @project.path
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml
deleted file mode 100644
index 49806ceaa9671182f21785534680362dac537c28..0000000000000000000000000000000000000000
--- a/app/views/projects/empty.html.haml
+++ /dev/null
@@ -1,49 +0,0 @@
-- if current_user && can?(current_user, :download_code, @project)
- = render 'shared/no_ssh'
- = render 'shared/no_password'
-
-= render "home_panel"
-
-.center.well
- %h3
- The repository for this project is empty
- %h4
- You can
- = link_to namespace_project_new_blob_path(@project.namespace, @project, 'master'), class: 'btn btn-new btn-lg' do
- add a file
- or do a push via the command line.
-
-%h4
- %strong Command line instructions
-%div.git-empty
- %fieldset
- %legend Git global setup
- %pre.dark
- :preserve
- git config --global user.name "#{git_user_name}"
- git config --global user.email "#{git_user_email}"
-
- %fieldset
- %legend Create a new repository
- %pre.dark
- :preserve
- mkdir #{@project.path}
- cd #{@project.path}
- git init
- touch README.md
- git add README.md
- git commit -m "first commit"
- git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
- git push -u origin master
-
- %fieldset
- %legend Push an existing Git repository
- %pre.dark
- :preserve
- cd existing_git_repo
- git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
- git push -u origin master
-
-- if can? current_user, :remove_project, @project
- .prepend-top-20
- = link_to 'Remove project', [@project.namespace.becomes(Namespace), @project], data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right"
diff --git a/app/views/projects/forks/error.html.haml b/app/views/projects/forks/error.html.haml
deleted file mode 100644
index 8eb4f795971939d0d5717b5e489e83593ea41a84..0000000000000000000000000000000000000000
--- a/app/views/projects/forks/error.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-- if @forked_project && !@forked_project.saved?
- .alert.alert-danger.alert-block
- %h4
- %i.fa.fa-code-fork
- Fork Error!
- %p
- You tried to fork
- = link_to_project @project
- but it failed for the following reason:
-
-
- - if @forked_project && @forked_project.errors.any?
- %p
- –
- = @forked_project.errors.full_messages.first
-
- %p
- = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork", class: "btn" do
- %i.fa.fa-code-fork
- Try to Fork again
diff --git a/app/views/projects/forks/new.html.haml b/app/views/projects/forks/new.html.haml
deleted file mode 100644
index 5a6c46f320885bd11a5d489780f52cc702450756..0000000000000000000000000000000000000000
--- a/app/views/projects/forks/new.html.haml
+++ /dev/null
@@ -1,39 +0,0 @@
-%h3.page-title Fork project
-%p.lead
- Click to fork the project to a user or group
-%hr
-
-.fork-namespaces
- - @namespaces.in_groups_of(6, false) do |group|
- .row
- - group.each do |namespace|
- .col-md-2.col-sm-3
- - if fork = namespace.find_fork_of(@project)
- .thumbnail.fork-exists-thumbnail
- = link_to project_path(fork), title: "Visit project fork", class: 'has_tooltip' do
- = image_tag namespace_icon(namespace, 200)
- .caption
- %h4=namespace.human_name
- %p
- = namespace.path
- - else
- .thumbnail.fork-thumbnail
- = link_to namespace_project_fork_path(@project.namespace, @project, namespace_key: namespace.id), title: "Fork here", method: "POST", class: 'has_tooltip' do
- = image_tag namespace_icon(namespace, 200)
- .caption
- %h4=namespace.human_name
- %p
- = namespace.path
-
- %p.light
- Fork is a copy of a project repository.
- %br
- Forking a repository allows you to do changes without affecting the original project.
-
-.save-project-loader.hide
- .center
- %h2
- %i.fa.fa-spinner.fa-spin
- Forking repository
- %p Please wait a moment, this page will automatically refresh when ready.
-
diff --git a/app/views/projects/go_import.html.haml b/app/views/projects/go_import.html.haml
deleted file mode 100644
index 87ac75a350fd7359245eaaf0f463207845078c71..0000000000000000000000000000000000000000
--- a/app/views/projects/go_import.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-!!! 5
-%html
- %head
- - web_url = [Gitlab.config.gitlab.url, @namespace, @id].join('/')
- %meta{name: "go-import", content: "#{web_url.split('://')[1]} git #{web_url}.git"}
diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml
deleted file mode 100644
index 9383df133058ef37fe6849cf6e5a373971a1f52d..0000000000000000000000000000000000000000
--- a/app/views/projects/graphs/_head.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%ul.nav.nav-tabs
- = nav_link(action: :show) do
- = link_to 'Contributors', namespace_project_graph_path
- = nav_link(action: :commits) do
- = link_to 'Commits', commits_namespace_project_graph_path
diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml
deleted file mode 100644
index 78b4c1923dd4669f09be01b43727a22ef01c8e69..0000000000000000000000000000000000000000
--- a/app/views/projects/graphs/commits.html.haml
+++ /dev/null
@@ -1,85 +0,0 @@
-= render 'head'
-
-%p.lead
- Commit statistics for
- %strong #{@repository.root_ref}
- #{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
-
-.row
- .col-md-6
- %ul
- %li
- %p.lead
- %strong #{@commits_graph.commits.size}
- commits during
- %strong #{@commits_graph.duration}
- days
- %li
- %p.lead
- Average
- %strong #{@commits_graph.commit_per_day}
- commits per day
- %li
- %p.lead
- Contributed by
- %strong #{@commits_graph.authors}
- authors
- .col-md-6
- %div
- %p.slead
- Commits per day of month
- %canvas#month-chart{width: 800, height: 400}
-.row
- .col-md-6
- %div
- %p.slead
- Commits per day hour (UTC)
- %canvas#hour-chart{width: 800, height: 400}
- .col-md-6
- %div
- %p.slead
- Commits per weekday
- %canvas#weekday-chart{width: 800, height: 400}
-
-:coffeescript
- data = {
- labels : #{@commits_per_time.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
- data : #{@commits_per_time.values.to_json}
- }]
- }
-
- ctx = $("#hour-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
-
- data = {
- labels : #{@commits_per_week_days.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
- data : #{@commits_per_week_days.values.to_json}
- }]
- }
-
- ctx = $("#weekday-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
-
- data = {
- labels : #{@commits_per_month.keys.to_json},
- datasets : [{
- fillColor : "rgba(220,220,220,0.5)",
- strokeColor : "rgba(220,220,220,1)",
- pointColor : "rgba(220,220,220,1)",
- pointStrokeColor : "#EEE",
- data : #{@commits_per_month.values.to_json}
- }]
- }
-
- ctx = $("#month-chart").get(0).getContext("2d");
- new Chart(ctx).Line(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml
deleted file mode 100644
index e3d5094ddc5fb6bf41774a02741bfdf80de69f14..0000000000000000000000000000000000000000
--- a/app/views/projects/graphs/show.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-= render 'head'
-.loading-graph
- .center
- %h3.page-title
- %i.fa.fa-spinner.fa-spin
- Building repository graph.
- %p.slead Please wait a moment, this page will automatically refresh when ready.
-
-.stat-graph.hide
- .header.clearfix
- %h3#date_header.page-title
- %p.light
- Commits to #{@project.default_branch}, excluding merge commits. Limited by 6,000 commits
- %input#brush_change{:type => "hidden"}
- .graphs
- #contributors-master
- #contributors.clearfix
- %ol.contributors-list.clearfix
-
-
-
-:coffeescript
- $.ajax
- type: "GET",
- url: location.href,
- success: (data) ->
- graph = new ContributorsStatGraph()
- graph.init(data)
-
- $("#brush_change").change ->
- graph.change_date_header()
- graph.redraw_authors()
-
- $(".stat-graph").fadeIn();
- $(".loading-graph").hide();
- dataType: "json"
-
diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml
deleted file mode 100644
index bbaddba31b9ee4bc0a2094317fa4cf8bf701e24e..0000000000000000000000000000000000000000
--- a/app/views/projects/hooks/index.html.haml
+++ /dev/null
@@ -1,68 +0,0 @@
-%h3.page-title
- Web hooks
-
-%p.light
- #{link_to "Web hooks ", help_page_path("web_hooks", "web_hooks"), class: "vlink"} can be
- used for binding events when something is happening within the project.
-
-%hr.clearfix
-
-= form_for [@project.namespace.becomes(Namespace), @project, @hook], as: :hook, url: namespace_project_hooks_path(@project.namespace, @project), html: { class: 'form-horizontal' } do |f|
- -if @hook.errors.any?
- .alert.alert-danger
- - @hook.errors.full_messages.each do |msg|
- %p= msg
- .form-group
- = f.label :url, "URL", class: 'control-label'
- .col-sm-10
- = f.text_field :url, class: "form-control", placeholder: 'http://example.com/trigger-ci.json'
- .form-group
- = f.label :url, "Trigger", class: 'control-label'
- .col-sm-10
- %div
- = f.check_box :push_events, class: 'pull-left'
- .prepend-left-20
- = f.label :push_events, class: 'list-label' do
- %strong Push events
- %p.light
- This url will be triggered by a push to the repository
- %div
- = f.check_box :tag_push_events, class: 'pull-left'
- .prepend-left-20
- = f.label :tag_push_events, class: 'list-label' do
- %strong Tag push events
- %p.light
- This url will be triggered when a new tag is pushed to the repository
- %div
- = f.check_box :issues_events, class: 'pull-left'
- .prepend-left-20
- = f.label :issues_events, class: 'list-label' do
- %strong Issues events
- %p.light
- This url will be triggered when an issue is created
- %div
- = f.check_box :merge_requests_events, class: 'pull-left'
- .prepend-left-20
- = f.label :merge_requests_events, class: 'list-label' do
- %strong Merge Request events
- %p.light
- This url will be triggered when a merge request is created
- .form-actions
- = f.submit "Add Web Hook", class: "btn btn-create"
-
--if @hooks.any?
- .panel.panel-default
- .panel-heading
- Web hooks (#{@hooks.count})
- %ul.well-list
- - @hooks.each do |hook|
- %li
- .pull-right
- = link_to 'Test Hook', test_namespace_project_hook_path(@project.namespace, @project, hook), class: "btn btn-sm btn-grouped"
- = link_to 'Remove', namespace_project_hook_path(@project.namespace, @project, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-sm btn-grouped"
- .clearfix
- %span.monospace= hook.url
- %p
- - %w(push_events tag_push_events issues_events merge_requests_events).each do |trigger|
- - if hook.send(trigger)
- %span.label.label-gray= trigger.titleize
diff --git a/app/views/projects/imports/new.html.haml b/app/views/projects/imports/new.html.haml
deleted file mode 100644
index 934b6b8c017212afeb9664e0c5d7ea931463ba1b..0000000000000000000000000000000000000000
--- a/app/views/projects/imports/new.html.haml
+++ /dev/null
@@ -1,21 +0,0 @@
-%h3.page-title
- - if @project.import_failed?
- Import failed. Retry?
- - else
- Import repository
-
-%hr
-
-= form_for @project, url: namespace_project_import_path(@project.namespace, @project), method: :post, html: { class: 'form-horizontal' } do |f|
- .form-group.import-url-data
- = f.label :import_url, class: 'control-label' do
- %span Import existing git repo
- .col-sm-10
- = f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git'
- .well.prepend-top-20
- This URL must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
- %br
- The import will time out after 4 minutes. For big repositories, use a clone/push combination.
- For SVN repositories, check #{link_to "this migrating from SVN doc.", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}
- .form-actions
- = f.submit 'Start import', class: "btn btn-create", tabindex: 4
diff --git a/app/views/projects/imports/show.html.haml b/app/views/projects/imports/show.html.haml
deleted file mode 100644
index 2d1fdafed24d31497feb9ac9dede513d38c9fbdf..0000000000000000000000000000000000000000
--- a/app/views/projects/imports/show.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.save-project-loader
- .center
- %h2
- %i.fa.fa-spinner.fa-spin
- Import in progress.
- %p.monospace git clone --bare #{hidden_pass_url(@project.import_url)}
- %p Please wait while we import the repository for you. Refresh at will.
- :javascript
- new ProjectImport();
diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml
deleted file mode 100644
index 288b48f45834dd790c4591d86e82a31e66c01ab9..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/_discussion.html.haml
+++ /dev/null
@@ -1,33 +0,0 @@
-- content_for :note_actions do
- - if can?(current_user, :modify_issue, @issue)
- - if @issue.closed?
- = link_to 'Reopen Issue', issue_path(@issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-grouped btn-reopen js-note-target-reopen", title: 'Reopen Issue'
- - else
- = link_to 'Close Issue', issue_path(@issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-grouped btn-close js-note-target-close", title: "Close Issue"
-.row
- %section.col-md-9
- .votes-holder.pull-right
- #votes= render 'votes/votes_block', votable: @issue
- .participants
- %span= pluralize(@issue.participants(current_user).count, 'participant')
- - @issue.participants(current_user).each do |participant|
- = link_to_member(@project, participant, name: false, size: 24)
- .voting_notes#notes= render "projects/notes/notes_with_form"
- %aside.col-md-3
- .issuable-affix
- .clearfix
- %span.slead.has_tooltip{:"data-original-title" => 'Cross-project reference'}
- = cross_project_reference(@project, @issue)
- %hr
- .context
- = render partial: 'issue_context', locals: { issue: @issue }
-
- - if @issue.labels.any?
- .issuable-context-title
- %label Labels
- .issue-show-labels
- - @issue.labels.each do |label|
- = link_to namespace_project_issues_path(@project.namespace, @project, label_name: label.name) do
- = render_colored_label(label)
- = link_to '#aside', class: 'show-aside' do
- %i.fa.fa-angle-left
diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml
deleted file mode 100644
index 7d7217eb2a81f4804a40a17a62f49775b39faa97..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/_form.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%div.issue-form-holder
- %h3.page-title= @issue.new_record? ? "Create Issue" : "Edit Issue ##{@issue.iid}"
- %hr
-
- = form_for [@project.namespace.becomes(Namespace), @project, @issue], html: { class: 'form-horizontal issue-form gfm-form' } do |f|
- = render 'projects/issuable_form', f: f, issuable: @issue
-
-:javascript
- $('.assign-to-me-link').on('click', function(e){
- $('#issue_assignee_id').val("#{current_user.id}").trigger("change");
- e.preventDefault();
- });
-
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
deleted file mode 100644
index 998e74d12cf8539b7fd7a5e9597da79de5c04cb5..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/_issue.html.haml
+++ /dev/null
@@ -1,52 +0,0 @@
-%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) }
- - if controller.controller_name == 'issues'
- .issue-check
- = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
-
- .issue-title
- %span.str-truncated
- = link_to_gfm issue.title, issue_path(issue), class: "row_title"
- .pull-right.light
- - if issue.closed?
- %span
- CLOSED
- - note_count = issue.notes.user.count
- - if note_count > 0
-
- %span
- %i.fa.fa-comments
- = note_count
-
- .issue-info
- = link_to "##{issue.iid}", issue_path(issue), class: "light"
- - if issue.assignee
- assigned to #{link_to_member(@project, issue.assignee)}
- - if issue.votes_count > 0
- = render 'votes/votes_inline', votable: issue
- - if issue.milestone
- %span
- %i.fa.fa-clock-o
- = issue.milestone.title
- - if issue.tasks?
- %span.task-status
- = issue.task_status
-
- .pull-right.issue-updated-at
- %small updated #{time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_update_ago')}
-
- .issue-labels
- - issue.labels.each do |label|
- = link_to namespace_project_issues_path(issue.project.namespace, issue.project, label_name: label.name) do
- = render_colored_label(label)
-
- .issue-actions
- - if can? current_user, :modify_issue, issue
- - if issue.closed?
- = link_to 'Reopen', issue_path(issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-sm btn-grouped reopen_issue btn-reopen", remote: true
- - else
- = link_to 'Close', issue_path(issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-sm btn-grouped close_issue btn-close", remote: true
- = link_to edit_namespace_project_issue_path(issue.project.namespace, issue.project, issue), class: "btn btn-sm edit-issue-link btn-grouped" do
- %i.fa.fa-pencil-square-o
- Edit
-
-
diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml
deleted file mode 100644
index 9228074d833a293b9fbc63df4e4f209be8c2c343..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/_issue_context.html.haml
+++ /dev/null
@@ -1,46 +0,0 @@
-= form_for [@project.namespace.becomes(Namespace), @project, @issue], remote: true, html: {class: 'edit-issue inline-update'} do |f|
- %div.prepend-top-20
- .issuable-context-title
- %label
- Assignee:
- - if issue.assignee
- %strong= link_to_member(@project, @issue.assignee, size: 24)
- - else
- none
- - if can?(current_user, :modify_issue, @issue)
- = users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: @issue.assignee_id, null_user: true, first_user: true)
-
- %div.prepend-top-20.clearfix
- .issuable-context-title
- %label
- Milestone:
- - if issue.milestone
- %span.back-to-milestone
- = link_to namespace_project_milestone_path(@project.namespace, @project, @issue.milestone) do
- %strong
- %i.fa.fa-clock-o
- = @issue.milestone.title
- - else
- none
- - if can?(current_user, :modify_issue, @issue)
- = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2 select2-compact js-select2 js-milestone'})
- = hidden_field_tag :issue_context
- = f.submit class: 'btn'
-
- - if current_user
- %div.prepend-top-20.clearfix
- .issuable-context-title
- %label
- Subscription:
- %button.btn.btn-block.subscribe-button
- %i.fa.fa-eye
- %span= @issue.subscribed?(current_user) ? "Unsubscribe" : "Subscribe"
- - subscribtion_status = @issue.subscribed?(current_user) ? "subscribed" : "unsubscribed"
- .subscription-status{"data-status" => subscribtion_status}
- .description-block.unsubscribed{class: ( "hidden" if @issue.subscribed?(current_user) )}
- You're not receiving notifications from this thread.
- .description-block.subscribed{class: ( "hidden" unless @issue.subscribed?(current_user) )}
- You're receiving notifications because you're subscribed to this thread.
-
-:coffeescript
- new Subscription("#{toggle_subscription_namespace_project_issue_path(@issue.project.namespace, @project, @issue)}")
diff --git a/app/views/projects/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml
deleted file mode 100644
index 5d243adb5fe4742e97328a5e12f30733d4e511e4..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/_issues.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-.panel.panel-default
- %ul.well-list.issues-list
- = render @issues
- - if @issues.blank?
- %li
- .nothing-here-block No issues to show
-
-- if @issues.present?
- .pull-right
- %span.issue_counter #{@issues.total_count}
- issues for this filter
-
- = paginate @issues, theme: "gitlab"
diff --git a/app/views/projects/issues/edit.html.haml b/app/views/projects/issues/edit.html.haml
deleted file mode 100644
index b1bc3ba0eba684a146b503fa89225bda4614e840..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/edit.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "form"
diff --git a/app/views/projects/issues/index.atom.builder b/app/views/projects/issues/index.atom.builder
deleted file mode 100644
index 126f2c07faaa68192fc4b4a09dc8586eced6c497..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/index.atom.builder
+++ /dev/null
@@ -1,12 +0,0 @@
-xml.instruct!
-xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
- xml.title "#{@project.name} issues"
- xml.link :href => namespace_project_issues_url(@project.namespace, @project, :atom), :rel => "self", :type => "application/atom+xml"
- xml.link :href => namespace_project_issues_url(@project.namespace, @project), :rel => "alternate", :type => "text/html"
- xml.id namespace_project_issues_url(@project.namespace, @project)
- xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any?
-
- @issues.each do |issue|
- issue_to_atom(xml, issue)
- end
-end
diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
deleted file mode 100644
index d3c7ae24a752f4b3298e9951c94de9bf67511b9f..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/index.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.append-bottom-10
- .pull-right
- .pull-left
- - if current_user
- .hidden-xs.pull-left
- = link_to namespace_project_issues_path(@project.namespace, @project, :atom, { private_token: current_user.private_token }), class: 'btn append-right-10' do
- %i.fa.fa-rss
-
- = render 'shared/issuable_search_form', path: namespace_project_issues_path(@project.namespace, @project)
-
- - if can? current_user, :write_issue, @project
- = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-new pull-left", title: "New Issue", id: "new_issue_link" do
- %i.fa.fa-plus
- New Issue
-
- = render 'shared/issuable_filter'
-
-.issues-holder
- = render "issues"
diff --git a/app/views/projects/issues/new.html.haml b/app/views/projects/issues/new.html.haml
deleted file mode 100644
index b1bc3ba0eba684a146b503fa89225bda4614e840..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/new.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "form"
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
deleted file mode 100644
index bd28d8a1db29a82f6f1cde6a54d7300a21606ebc..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/show.html.haml
+++ /dev/null
@@ -1,40 +0,0 @@
-.issue
- .issue-details
- %h4.page-title
- .issue-box{ class: issue_box_class(@issue) }
- - if @issue.closed?
- Closed
- - else
- Open
- Issue ##{@issue.iid}
- %small.creator
- · created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)}
-
- .pull-right
- - if can?(current_user, :write_issue, @project)
- = link_to new_namespace_project_issue_path(@project.namespace, @project), class: "btn btn-grouped new-issue-link", title: "New Issue", id: "new_issue_link" do
- %i.fa.fa-plus
- New Issue
- - if can?(current_user, :modify_issue, @issue)
- - if @issue.closed?
- = link_to 'Reopen', issue_path(@issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-grouped btn-reopen"
- - else
- = link_to 'Close', issue_path(@issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-grouped btn-close", title: "Close Issue"
-
- = link_to edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: "btn btn-grouped issuable-edit" do
- %i.fa.fa-pencil-square-o
- Edit
-
- %hr
- %h2.issue-title
- = gfm escape_once(@issue.title)
- %div
- - if @issue.description.present?
- .description
- .wiki
- = preserve do
- = markdown(@issue.description, parse_tasks: true)
-
- %hr
- .issue-discussion
- = render "projects/issues/discussion"
diff --git a/app/views/projects/issues/update.js.haml b/app/views/projects/issues/update.js.haml
deleted file mode 100644
index 1d38662bff8f18237bdbab4f5d1d76e635849852..0000000000000000000000000000000000000000
--- a/app/views/projects/issues/update.js.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-- if params[:status_only]
- - if @issue.valid?
- :plain
- $("##{dom_id(@issue)}").fadeOut();
-- elsif params[:issue_context]
- $('.context').html("#{escape_javascript(render partial: 'issue_context', locals: { issue: @issue })}");
- $('.context').effect('highlight');
- - if @issue.milestone
- $('.milestone-nav-link').replaceWith("| Milestone #{escape_javascript(link_to @issue.milestone.title, namespace_project_milestone_path(@issue.project.namespace, @issue.project, @issue.milestone))}")
- - else
- $('.milestone-nav-link').html('')
-
-
-$('select.select2').select2({width: 'resolve', dropdownAutoWidth: true})
-$('.edit-issue.inline-update input[type="submit"]').hide();
-new UsersSelect()
-new Issue();
diff --git a/app/views/projects/labels/_label.html.haml b/app/views/projects/labels/_label.html.haml
deleted file mode 100644
index 82829452862406d24f4592ac91c03b0b6bca5fe0..0000000000000000000000000000000000000000
--- a/app/views/projects/labels/_label.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%li{id: dom_id(label)}
- = render_colored_label(label)
- .pull-right
- %strong.append-right-20
- = link_to namespace_project_issues_path(@project.namespace, @project, label_name: label.name) do
- = pluralize label.open_issues_count, 'open issue'
-
- - if can? current_user, :admin_label, @project
- = link_to 'Edit', edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn'
- = link_to 'Remove', namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-remove remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?"}
diff --git a/app/views/projects/labels/destroy.js.haml b/app/views/projects/labels/destroy.js.haml
deleted file mode 100644
index 1b4c83ab0979ff45905f9d5d17171015e80dc66d..0000000000000000000000000000000000000000
--- a/app/views/projects/labels/destroy.js.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-- if @project.labels.size == 0
- $('.labels').load(document.URL + ' .light-well').hide().fadeIn(1000)
diff --git a/app/views/projects/labels/edit.html.haml b/app/views/projects/labels/edit.html.haml
deleted file mode 100644
index e003d1dfe7f586ffffed167502e51f428ddbb9be..0000000000000000000000000000000000000000
--- a/app/views/projects/labels/edit.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%h3
- Edit label
- %span.light #{@label.name}
-.back-link
- = link_to namespace_project_labels_path(@project.namespace, @project) do
- ← To labels list
-%hr
-= render 'form'
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
deleted file mode 100644
index 0700e72d39c8e659a4195a009552d6e0383c28df..0000000000000000000000000000000000000000
--- a/app/views/projects/labels/index.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-- if can? current_user, :admin_label, @project
- = link_to new_namespace_project_label_path(@project.namespace, @project), class: "pull-right btn btn-new" do
- New label
-%h3.page-title
- Labels
-%hr
-
-.labels
- - if @labels.present?
- %ul.bordered-list.manage-labels-list
- = render @labels
- = paginate @labels, theme: 'gitlab'
- - else
- .light-well
- .nothing-here-block Create first label or #{link_to 'generate', generate_namespace_project_labels_path(@project.namespace, @project), method: :post} default set of labels
diff --git a/app/views/projects/labels/new.html.haml b/app/views/projects/labels/new.html.haml
deleted file mode 100644
index 0683ed5d4fbcf6ae9f5b0cfb3e783cc7c6084654..0000000000000000000000000000000000000000
--- a/app/views/projects/labels/new.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%h3 New label
-.back-link
- = link_to namespace_project_labels_path(@project.namespace, @project) do
- ← To labels list
-%hr
-= render 'form'
diff --git a/app/views/projects/merge_requests/_discussion.html.haml b/app/views/projects/merge_requests/_discussion.html.haml
deleted file mode 100644
index eb72eaabd8b9482c5e90e423ffc1f595304ab35d..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_discussion.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-- content_for :note_actions do
- - if can?(current_user, :modify_merge_request, @merge_request)
- - if @merge_request.open?
- = link_to 'Close', merge_request_path(@merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request"
- - if @merge_request.closed?
- = link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request"
-
-.row
- %section.col-md-9
- .votes-holder.pull-right
- #votes= render 'votes/votes_block', votable: @merge_request
- = render "projects/merge_requests/show/participants"
- = render "projects/notes/notes_with_form"
- %aside.col-md-3
- .issuable-affix
- .clearfix
- %span.slead.has_tooltip{:"data-original-title" => 'Cross-project reference'}
- = cross_project_reference(@project, @merge_request)
- %hr
- .context
- = render partial: 'projects/merge_requests/show/context', locals: { merge_request: @merge_request }
-
- - if @merge_request.labels.any?
- .issuable-context-title
- %label Labels
- .merge-request-show-labels
- - @merge_request.labels.each do |label|
- = link_to namespace_project_merge_requests_path(@project.namespace, @project, label_name: label.name) do
- = render_colored_label(label)
- = link_to '#aside', class: 'show-aside' do
- %i.fa.fa-angle-left
diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml
deleted file mode 100644
index 1c7160bce5fb495190ca0732f7991365ed18ba4e..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_form.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form' } do |f|
- .merge-request-form-info
- = render 'projects/issuable_form', f: f, issuable: @merge_request
-
-:javascript
- disableButtonIfEmptyField("#merge_request_title", ".btn-save");
- $('.assign-to-me-link').on('click', function(e){
- $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change");
- e.preventDefault();
- });
-
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
diff --git a/app/views/projects/merge_requests/_head.html.haml b/app/views/projects/merge_requests/_head.html.haml
deleted file mode 100644
index 19e4dab874bcd9e805232b5abf8bd6aa1c2f2ab7..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_head.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-.top-tabs
- = link_to namespace_project_merge_requests_path(@project.namespace, @project), class: "tab #{'active' if current_page?(namespace_project_merge_requests_path(@project.namespace, @project)) }" do
- %span
- Merge Requests
-
diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml
deleted file mode 100644
index 4f30d1e69f79fd0525bfb4a290bffc15ad19f011..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_merge_request.html.haml
+++ /dev/null
@@ -1,48 +0,0 @@
-%li{ class: mr_css_classes(merge_request) }
- .merge-request-title
- %span.str-truncated
- = link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
- .pull-right.light
- - if merge_request.merged?
- %span
- %i.fa.fa-check
- MERGED
- - elsif merge_request.closed?
- %span
- %i.fa.fa-close
- CLOSED
- - else
- %span.hidden-xs.hidden-sm
- %span.label-branch<
- %i.fa.fa-code-fork
- %span= merge_request.target_branch
- - note_count = merge_request.mr_and_commit_notes.user.count
- - if note_count > 0
-
- %span
- %i.fa.fa-comments
- = note_count
- .merge-request-info
- = link_to "##{merge_request.iid}", merge_request_path(merge_request), class: "light"
- - if merge_request.assignee
- assigned to #{link_to_member(merge_request.source_project, merge_request.assignee)}
- - else
- Unassigned
- - if merge_request.votes_count > 0
- = render 'votes/votes_inline', votable: merge_request
- - if merge_request.milestone_id?
- %span
- %i.fa.fa-clock-o
- = merge_request.milestone.title
- - if merge_request.tasks?
- %span.task-status
- = merge_request.task_status
-
-
- .pull-right.hidden-xs
- %small updated #{time_ago_with_tooltip(merge_request.updated_at, 'bottom', 'merge_request_updated_ago')}
-
- .merge-request-labels
- - merge_request.labels.each do |label|
- = link_to namespace_project_merge_requests_path(merge_request.project.namespace, merge_request.project, label_name: label.name) do
- = render_colored_label(label)
diff --git a/app/views/projects/merge_requests/_merge_requests.html.haml b/app/views/projects/merge_requests/_merge_requests.html.haml
deleted file mode 100644
index b8a0ca9a42f31cf6aaa35adaa798e209fd2fdd34..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_merge_requests.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-.panel.panel-default
- %ul.well-list.mr-list
- = render @merge_requests
- - if @merge_requests.blank?
- %li
- .nothing-here-block No merge requests to show
-
-- if @merge_requests.present?
- .pull-right
- %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
-
- = paginate @merge_requests, theme: "gitlab"
-
diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml
deleted file mode 100644
index 17e76059fdbc4664ff23f3df89bd947325074b54..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_new_compare.html.haml
+++ /dev/null
@@ -1,89 +0,0 @@
-%h3.page-title Compare branches for new Merge Request
-%hr
-
-= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], url: new_namespace_project_merge_request_path(@project.namespace, @project), method: :get, html: { class: "merge-request-form form-inline" } do |f|
- .hide.alert.alert-danger.mr-compare-errors
- .merge-request-branches.row
- .col-md-6
- .panel.panel-default
- .panel-heading
- %strong Source branch
- .panel-body
- = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? })
-
- = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'})
- .panel-footer
- .mr_source_commit
-
- .col-md-6
- .panel.panel-default
- .panel-heading
- %strong Target branch
- .panel-body
- - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project]
- = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? })
-
- = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'})
- .panel-footer
- .mr_target_commit
-
- - if @merge_request.errors.any?
- .alert.alert-danger
- - @merge_request.errors.full_messages.each do |msg|
- %div= msg
-
- - elsif @merge_request.source_branch.present? && @merge_request.target_branch.present?
- - if @merge_request.compare_failed
- .alert.alert-danger
- %h4 Compare failed
- %p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches.
- - else
- .light-well
- .center
- %h4
- There isn't anything to merge.
- %p.slead
- - if @merge_request.source_branch == @merge_request.target_branch
- You'll need to use different branch names to get a valid comparison.
- - else
- %span.label-branch #{@merge_request.source_branch}
- and
- %span.label-branch #{@merge_request.target_branch}
- are the same.
-
-
- %hr
- = f.submit 'Compare branches', class: "btn btn-primary mr-compare-btn"
-
-:javascript
- var source_branch = $("#merge_request_source_branch")
- , target_branch = $("#merge_request_target_branch")
- , target_project = $("#merge_request_target_project_id");
-
- $.get("#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {ref: source_branch.val() });
- $.get("#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() });
-
- target_project.on("change", function() {
- $.get("#{update_branches_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: $(this).val() });
- });
- source_branch.on("change", function() {
- $.get("#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {ref: $(this).val() });
- $(".mr-compare-errors").fadeOut();
- $(".mr-compare-btn").enable();
- });
- target_branch.on("change", function() {
- $.get("#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: target_project.val(),ref: $(this).val() });
- $(".mr-compare-errors").fadeOut();
- $(".mr-compare-btn").enable();
- });
-
-
-:coffeescript
-
- $(".merge-request-form").on 'submit', ->
- if $("#merge_request_source_branch").val() is "" or $('#merge_request_target_branch').val() is ""
- $(".mr-compare-errors").html("You must select source and target branch to proceed")
- $(".mr-compare-errors").fadeIn()
- event.preventDefault()
- return
-
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
deleted file mode 100644
index d986ce67c0c6b2588e92bebd783a360bc4772445..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ /dev/null
@@ -1,123 +0,0 @@
-%h3.page-title
- New merge request
-%p.slead
- From
- %strong.label-branch #{@merge_request.source_project_namespace}:#{@merge_request.source_branch}
- %span into
- %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch}
-
- %span.pull-right
- = link_to 'Change branches', new_namespace_project_merge_request_path(@project.namespace, @project)
-
-= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f|
- .merge-request-form-info
- .form-group
- = f.label :title, class: 'control-label' do
- %strong Title *
- .col-sm-10
- = f.text_field :title, maxlength: 255, autofocus: true, class: 'form-control pad js-gfm-input', required: true
- .form-group.issuable-description
- = f.label :description, 'Description', class: 'control-label'
- .col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
- = render 'projects/zen', f: f, attr: :description, classes: 'description form-control'
-
- .col-sm-12-hint
- .pull-left
- Parsed with
- #{link_to 'Gitlab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
- .pull-right
- Attach files by dragging & dropping
- or #{link_to 'selecting them', '#', class: 'markdown-selector'}.
-
- .clearfix
- .error-alert
- %hr
- .form-group
- .issue-assignee
- = f.label :assignee_id, class: 'control-label' do
- %i.fa.fa-user
- Assign to
- .col-sm-10
- = users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id, project_id: @merge_request.target_project_id)
-
- = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
- .form-group
- .issue-milestone
- = f.label :milestone_id, class: 'control-label' do
- %i.fa.fa-clock-o
- Milestone
- .col-sm-10
- - if milestone_options(@merge_request).present?
- = f.select(:milestone_id, milestone_options(@merge_request), {include_blank: 'Select milestone'}, {class: 'select2'})
- - else
- %span.light No open milestones available.
-
- - if can? current_user, :admin_milestone, @merge_request.target_project
- = link_to 'Create new milestone', new_namespace_project_milestone_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
- .form-group
- = f.label :label_ids, class: 'control-label' do
- %i.fa.fa-tag
- Labels
- .col-sm-10
- - if @merge_request.target_project.labels.any?
- = f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, {selected: @merge_request.label_ids}, multiple: true, class: 'select2'
- - else
- %span.light No labels yet.
-
- - if can? current_user, :admin_label, @merge_request.target_project
- = link_to 'Create new label', new_namespace_project_label_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
-
- .form-actions
- - if guide_url = contribution_guide_url(@target_project)
- %p
- Please review the
- %strong #{link_to 'guidelines for contribution', guide_url}
- to this repository.
- = f.hidden_field :source_project_id
- = f.hidden_field :source_branch
- = f.hidden_field :target_project_id
- = f.hidden_field :target_branch
- = f.submit 'Submit merge request', class: 'btn btn-create'
-
-.mr-compare.merge-request
- %ul.nav.nav-tabs.merge-request-tabs
- %li.commits-tab{data: {action: 'commits'}}
- = link_to url_for(params) do
- %i.fa.fa-history
- Commits
- %span.badge= @commits.size
- %li.diffs-tab{data: {action: 'diffs'}}
- = link_to url_for(params) do
- %i.fa.fa-list-alt
- Changes
- %span.badge= @diffs.size
-
- .commits.tab-content
- = render "projects/commits/commits", project: @project
- .diffs.tab-content
- - if @diffs.present?
- = render "projects/diffs/diffs", diffs: @diffs, project: @project
- - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- .alert.alert-danger
- %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
- %p To preserve performance the line changes are not shown.
- - else
- .alert.alert-danger
- %h4 This comparison includes a huge diff.
- %p To preserve performance the line changes are not shown.
-
-:javascript
- $('.assign-to-me-link').on('click', function(e){
- $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change");
- e.preventDefault();
- });
-
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
-
-:javascript
- var merge_request
- merge_request = new MergeRequest({
- action: 'commits'
- });
-
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
deleted file mode 100644
index a74aede4e6bacba98678caafce79a91a7ddf2009..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/_show.html.haml
+++ /dev/null
@@ -1,77 +0,0 @@
-.merge-request{'data-url' => merge_request_path(@merge_request)}
- .merge-request-details
- = render "projects/merge_requests/show/mr_title"
- %hr
- = render "projects/merge_requests/show/mr_box"
- %hr
- .append-bottom-20
- .slead
- %span From
- - if @merge_request.for_fork?
- %strong.label-branch<
- - if @merge_request.source_project
- = link_to @merge_request.source_project_namespace, namespace_project_path(@merge_request.source_project.namespace, @merge_request.source_project)
- - else
- \ #{@merge_request.source_project_namespace}
- \:#{@merge_request.source_branch}
- %span into
- %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch}
- - else
- %strong.label-branch #{@merge_request.source_branch}
- %span into
- %strong.label-branch #{@merge_request.target_branch}
- - if @merge_request.open?
- %span.pull-right
- .btn-group
- %a.btn.dropdown-toggle{ data: {toggle: :dropdown} }
- %i.fa.fa-download
- Download as
- %span.caret
- %ul.dropdown-menu
- %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch)
- %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
-
- = render "projects/merge_requests/show/how_to_merge"
- = render "projects/merge_requests/show/state_widget"
-
- - if @commits.present?
- %ul.nav.nav-tabs.merge-request-tabs
- %li.notes-tab{data: {action: 'notes'}}
- = link_to merge_request_path(@merge_request) do
- %i.fa.fa-comments
- Discussion
- %span.badge= @merge_request.mr_and_commit_notes.user.count
- %li.commits-tab{data: {action: 'commits'}}
- = link_to merge_request_path(@merge_request), title: 'Commits' do
- %i.fa.fa-history
- Commits
- %span.badge= @commits.size
- %li.diffs-tab{data: {action: 'diffs'}}
- = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) do
- %i.fa.fa-list-alt
- Changes
- %span.badge= @merge_request.diffs.size
-
- .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" }
- = render "projects/merge_requests/discussion"
- .commits.tab-content
- = render "projects/merge_requests/show/commits"
- .diffs.tab-content
- - if current_page?(action: 'diffs')
- = render "projects/merge_requests/show/diffs"
-
- .mr-loading-status
- = spinner
-
-
-:javascript
- var merge_request;
-
- merge_request = new MergeRequest({
- url_to_automerge_check: "#{automerge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
- check_enable: #{@merge_request.unchecked? ? "true" : "false"},
- url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
- ci_enable: #{@project.ci_service ? "true" : "false"},
- current_status: "#{@merge_request.merge_status_name}",
- action: "#{controller.action_name}"
- });
diff --git a/app/views/projects/merge_requests/automerge.js.haml b/app/views/projects/merge_requests/automerge.js.haml
deleted file mode 100644
index a53cbb150a41fc7f5e3a004c86496127789406da..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/automerge.js.haml
+++ /dev/null
@@ -1,6 +0,0 @@
--if @status
- :plain
- merge_request.mergeInProgress();
--else
- :plain
- merge_request.alreadyOrCannotBeMerged()
diff --git a/app/views/projects/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml
deleted file mode 100644
index 8372afa61b53b4cb5eb1de3615f725ec2b48cf93..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/branch_from.js.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-:plain
- $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project, false)}");
diff --git a/app/views/projects/merge_requests/branch_to.js.haml b/app/views/projects/merge_requests/branch_to.js.haml
deleted file mode 100644
index f7ede0ded53d42ce7b1a801ec182fd9e84f6c296..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/branch_to.js.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-:plain
- $(".mr_target_commit").html("#{commit_to_html(@commit, @target_project, false)}");
diff --git a/app/views/projects/merge_requests/diffs.html.haml b/app/views/projects/merge_requests/diffs.html.haml
deleted file mode 100644
index 2a5b8b1441ef89345d4d5357b4f5b557d80fe7e7..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/diffs.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "show"
diff --git a/app/views/projects/merge_requests/edit.html.haml b/app/views/projects/merge_requests/edit.html.haml
deleted file mode 100644
index 839c63986ab36a155125e67a5739f0702dd8ef6e..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/edit.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title
- = "Edit merge request ##{@merge_request.iid}"
-%hr
-= render 'form'
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
deleted file mode 100644
index d7992bdd19ea8a0412d94cebcaa28598514c83ff..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/index.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-.append-bottom-10
- .pull-right
- = render 'shared/issuable_search_form', path: namespace_project_merge_requests_path(@project.namespace, @project)
-
- - if can? current_user, :write_merge_request, @project
- = link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new pull-left", title: "New Merge Request" do
- %i.fa.fa-plus
- New Merge Request
- = render 'shared/issuable_filter'
-.merge-requests-holder
- = render 'merge_requests'
diff --git a/app/views/projects/merge_requests/invalid.html.haml b/app/views/projects/merge_requests/invalid.html.haml
deleted file mode 100644
index b9c466657de4f01fe66edf0f9f530e8664dfc9db..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/invalid.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-.merge-request
- = render "projects/merge_requests/show/mr_title"
- = render "projects/merge_requests/show/mr_box"
-
- .alert.alert-danger
- %p
- We cannot render this merge request properly because
- - if @merge_request.for_fork? && !@merge_request.source_project
- fork project was removed
- - elsif !@merge_request.source_branch_exists?
- %span.label.label-inverse= @merge_request.source_branch
- does not exist in
- %span.label.label-info= @merge_request.source_project_path
- - elsif !@merge_request.target_branch_exists?
- %span.label.label-inverse= @merge_request.target_branch
- does not exist in
- %span.label.label-info= @merge_request.target_project_path
- - else
- of internal error
-
- %strong
- Please close Merge Request or change branches with existing one
-
diff --git a/app/views/projects/merge_requests/new.html.haml b/app/views/projects/merge_requests/new.html.haml
deleted file mode 100644
index 4756903d0e00465a47b0bcdd5cfa93cd0a4414c9..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/new.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- if @merge_request.can_be_created
- = render 'new_submit'
-- else
- = render 'new_compare'
diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml
deleted file mode 100644
index 2a5b8b1441ef89345d4d5357b4f5b557d80fe7e7..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "show"
diff --git a/app/views/projects/merge_requests/show/_commits.html.haml b/app/views/projects/merge_requests/show/_commits.html.haml
deleted file mode 100644
index 3b7f283daf0468774e60114d0c3490d26c71cefc..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_commits.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "projects/commits/commits", project: @merge_request.source_project
diff --git a/app/views/projects/merge_requests/show/_context.html.haml b/app/views/projects/merge_requests/show/_context.html.haml
deleted file mode 100644
index 105562fb05e31bfa02caae672989f52a1533ac7b..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_context.html.haml
+++ /dev/null
@@ -1,48 +0,0 @@
-= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], remote: true, html: {class: 'edit-merge_request inline-update'} do |f|
- %div.prepend-top-20
- .issuable-context-title
- %label
- Assignee:
- - if @merge_request.assignee
- %strong= link_to_member(@project, @merge_request.assignee, size: 24)
- - else
- none
- .issuable-context-selectbox
- - if can?(current_user, :modify_merge_request, @merge_request)
- = users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: @merge_request.assignee_id, null_user: true)
-
- %div.prepend-top-20.clearfix
- .issuable-context-title
- %label
- Milestone:
- - if @merge_request.milestone
- %span.back-to-milestone
- = link_to namespace_project_milestone_path(@project.namespace, @project, @merge_request.milestone) do
- %strong
- %i.fa.fa-clock-o
- = @merge_request.milestone.title
- - else
- none
- .issuable-context-selectbox
- - if can?(current_user, :modify_merge_request, @merge_request)
- = f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2 select2-compact js-select2 js-milestone'})
- = hidden_field_tag :merge_request_context
- = f.submit class: 'btn'
-
- - if current_user
- %div.prepend-top-20.clearfix
- .issuable-context-title
- %label
- Subscription:
- %button.btn.btn-block.subscribe-button
- %i.fa.fa-eye
- %span= @merge_request.subscribed?(current_user) ? "Unsubscribe" : "Subscribe"
- - subscribtion_status = @merge_request.subscribed?(current_user) ? "subscribed" : "unsubscribed"
- .subscription-status{"data-status" => subscribtion_status}
- .description-block.unsubscribed{class: ( "hidden" if @merge_request.subscribed?(current_user) )}
- You're not receiving notifications from this thread.
- .description-block.subscribed{class: ( "hidden" unless @merge_request.subscribed?(current_user) )}
- You're receiving notifications because you're subscribed to this thread.
-
-:coffeescript
- new Subscription("#{toggle_subscription_namespace_project_merge_request_path(@merge_request.project.namespace, @project, @merge_request)}")
diff --git a/app/views/projects/merge_requests/show/_diffs.html.haml b/app/views/projects/merge_requests/show/_diffs.html.haml
deleted file mode 100644
index 786b5f39063327cf28f8dca26d3f89965b46f7cd..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_diffs.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-- if @merge_request_diff.collected?
- = render "projects/diffs/diffs", diffs: @merge_request.diffs, project: @merge_request.source_project
-- elsif @merge_request_diff.empty?
- .nothing-here-block Nothing to merge from #{@merge_request.source_branch} into #{@merge_request.target_branch}
-- else
- .alert.alert-warning
- %h4
- Changes view for this comparison is extremely large.
- %p
- You can
- = link_to "download it", merge_request_path(@merge_request, format: :diff), class: "vlink"
- instead.
diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml
deleted file mode 100644
index 63db4b30968c1fd23f8ad7e110df5ca79e6e9fdd..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml
+++ /dev/null
@@ -1,53 +0,0 @@
-%div#modal_merge_info.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3 How to merge
- .modal-body
- - if @merge_request.for_fork?
- - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path
- - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path
- %p
- %strong Step 1.
- Fetch the code and create a new branch pointing to it
- %pre.dark
- :preserve
- git fetch #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch}
- git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} FETCH_HEAD
- %p
- %strong Step 2.
- Merge the branch and push the changes to GitLab
- %pre.dark
- :preserve
- git checkout #{@merge_request.target_branch}
- git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch}
- git push origin #{@merge_request.target_branch}
- - else
- %p
- %strong Step 1.
- Update the repo and checkout the branch we are going to merge
- %pre.dark
- :preserve
- git fetch origin
- git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch}
- %p
- %strong Step 2.
- Merge the branch and push the changes to GitLab
- %pre.dark
- :preserve
- git checkout #{@merge_request.target_branch}
- git merge --no-ff #{@merge_request.source_branch}
- git push origin #{@merge_request.target_branch}
-
-
-:javascript
- $(function(){
- var modal = $('#modal_merge_info').modal({modal: true, show:false});
- $('.how_to_merge_link').bind("click", function(){
- modal.show();
- });
- $('.modal-header .close').bind("click", function(){
- modal.hide();
- })
- })
diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml
deleted file mode 100644
index 9f51f84d40024e3f19be9df20b618119fe9bbfda..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_mr_accept.html.haml
+++ /dev/null
@@ -1,74 +0,0 @@
-- unless @allowed_to_merge
- - if @project.archived?
- %p
- %strong Archived projects cannot be committed to!
- - else
- .automerge_widget.cannot_be_merged.hide
- %strong This can't be merged automatically, even if it could be merged you don't have the permission to do so.
- .automerge_widget.can_be_merged.hide
- %strong This can be merged automatically but you don't have the permission to do so.
-
-
-- if @show_merge_controls
- .automerge_widget.can_be_merged.hide
- .clearfix
- = form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post do |f|
- .accept-merge-holder.clearfix.js-toggle-container
- .accept-action
- = f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request"
- - if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
- .accept-control.checkbox
- = label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
- = check_box_tag :should_remove_source_branch
- Remove source-branch
- .accept-control
- = link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
- %i.fa.fa-edit
- Modify commit message
- .js-toggle-content.hide.prepend-top-20
- = render 'shared/commit_message_container', params: params,
- text: @merge_request.merge_commit_message,
- rows: 14, hint: true
-
- %br
- .light
- If you still want to merge this request manually - use
- %strong
- = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
-
-
- .automerge_widget.no_satellite.hide
- %p
- %span
- %strong This repository does not have satellite. Ask an administrator to fix this issue
-
- .automerge_widget.cannot_be_merged.hide
- %h4
- This request can't be merged with GitLab.
- You should do it manually with
- %strong
- = link_to "#modal_merge_info", class: "underlined-link how_to_merge_link", title: "How To Merge", "data-toggle" => "modal" do
- command line
-
- %p
- %button.btn.disabled
- %i.fa.fa-warning
- Accept Merge Request
-
- This usually happens when git can not resolve conflicts between branches automatically.
-
- .automerge_widget.unchecked
- %p
- %strong
- %i.fa.fa-spinner.fa-spin
- Checking for ability to automatically merge…
-
- .automerge_widget.already_cannot_be_merged.hide
- %p
- %strong This merge request can not be merged. Try to reload the page.
-
- .merge-in-progress.hide
- %p
- %i.fa.fa-spinner.fa-spin
-
- Merge is in progress. Please wait. Page will be automatically reloaded.
diff --git a/app/views/projects/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml
deleted file mode 100644
index ada9ae58b8f7d34905393b8a3f4d0d74be8ba5f8..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_mr_box.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-%h2.issue-title
- = gfm escape_once(@merge_request.title)
-
-%div
- - if @merge_request.description.present?
- .description
- .wiki
- = preserve do
- = markdown(@merge_request.description, parse_tasks: true)
diff --git a/app/views/projects/merge_requests/show/_mr_ci.html.haml b/app/views/projects/merge_requests/show/_mr_ci.html.haml
deleted file mode 100644
index ffa3f7b0e36a120122527933f918f727056b69a7..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_mr_ci.html.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-- if @commits.any?
- .ci_widget.ci-success{style: "display:none"}
- %i.fa.fa-check
- %span CI build passed
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
-
- .ci_widget.ci-failed{style: "display:none"}
- %i.fa.fa-times
- %span CI build failed
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- - [:running, :pending].each do |status|
- .ci_widget{class: "ci-#{status}", style: "display:none"}
- %i.fa.fa-clock-o
- %span CI build #{status}
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- .ci_widget
- %i.fa.fa-spinner
- Checking for CI status for #{@merge_request.last_commit_short_sha}
-
- .ci_widget.ci-canceled{style: "display:none"}
- %i.fa.fa-times
- %span CI build canceled
- for #{@merge_request.last_commit_short_sha}.
- = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
-
- .ci_widget.ci-error{style: "display:none"}
- %i.fa.fa-times
- %span Cannot connect to the CI server. Please check your settings and try again.
diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml
deleted file mode 100644
index 46e92a9c55845956ab4172ba1df1f0055b037317..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_mr_title.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-%h4.page-title
- .issue-box{ class: issue_box_class(@merge_request) }
- - if @merge_request.merged?
- Merged
- - elsif @merge_request.closed?
- Closed
- - else
- Open
- = "Merge Request ##{@merge_request.iid}"
- %small.creator
- ·
- created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)}
-
- .issue-btn-group.pull-right
- - if can?(current_user, :modify_merge_request, @merge_request)
- - if @merge_request.open?
- = link_to 'Close', merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, class: "btn btn-grouped btn-close", title: "Close merge request"
- = link_to edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: "btn btn-grouped issuable-edit", id: "edit_merge_request" do
- %i.fa.fa-pencil-square-o
- Edit
- - if @merge_request.closed?
- = link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link", title: "Close merge request"
diff --git a/app/views/projects/merge_requests/show/_no_accept.html.haml b/app/views/projects/merge_requests/show/_no_accept.html.haml
deleted file mode 100644
index 423fcd48e253c5064f9862c91fb653bdddf281b1..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_no_accept.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%h4
- Can't be merged
-%p
- This merge request can not be accepted because branch
- - unless @merge_request.source_branch_exists?
- %span.label.label-inverse= @merge_request.source_branch
- does not exist in
- %span.label.label-info= @merge_request.source_project_path
- - else
- %span.label.label-inverse= @merge_request.target_branch
- does not exist in
- %span.label.label-info= @merge_request.target_project_path
- %br
- %strong Please close this merge request or change branches with existing one
diff --git a/app/views/projects/merge_requests/show/_participants.html.haml b/app/views/projects/merge_requests/show/_participants.html.haml
deleted file mode 100644
index 9c93fa55fe60ddea43dd2512d18139e6ea00a97a..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_participants.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-.participants
- %span #{@merge_request.participants(current_user).count} participants
- - @merge_request.participants(current_user).each do |participant|
- = link_to_member(@project, participant, name: false, size: 24)
diff --git a/app/views/projects/merge_requests/show/_remove_source_branch.html.haml b/app/views/projects/merge_requests/show/_remove_source_branch.html.haml
deleted file mode 100644
index 59cb85edfce11b934d39718c9500c9aea963c101..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_remove_source_branch.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-- if @source_branch.blank?
- Source branch has been removed
-
-- elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && @merge_request.merged?
- .remove_source_branch_widget
- %p Changes merged into #{@merge_request.target_branch}. You can remove source branch now
- = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
- %i.fa.fa-times
- Remove Source Branch
-
- .remove_source_branch_widget.failed.hide
- Failed to remove source branch '#{@merge_request.source_branch}'
-
- .remove_source_branch_in_progress.hide
- %i.fa.fa-spinner.fa-spin
-
- Removing source branch '#{@merge_request.source_branch}'. Please wait. Page will be automatically reloaded.
diff --git a/app/views/projects/merge_requests/show/_state_widget.html.haml b/app/views/projects/merge_requests/show/_state_widget.html.haml
deleted file mode 100644
index 44bd9347f514568c34b31d9c8c6f7b85e0abd8d6..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/show/_state_widget.html.haml
+++ /dev/null
@@ -1,50 +0,0 @@
-.mr-state-widget
- - if @merge_request.source_project.ci_service && @commits.any?
- .mr-widget-heading
- = render "projects/merge_requests/show/mr_ci"
- .mr-widget-body
- - if @merge_request.open?
- - if @merge_request.source_branch_exists? && @merge_request.target_branch_exists?
- = render "projects/merge_requests/show/mr_accept"
- - else
- = render "projects/merge_requests/show/no_accept"
-
- - if @merge_request.closed?
- %h4
- Closed
- - if @merge_request.closed_event
- by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)}
- #{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
- %p Changes were not merged into target branch
-
- - if @merge_request.merged?
- %h4
- Merged
- - if @merge_request.merge_event
- by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
- #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
- = render "projects/merge_requests/show/remove_source_branch"
-
- - if @merge_request.locked?
- %h4
- Merge in progress...
- %p
- Merging is in progress. While merging this request is locked and cannot be closed.
-
- - unless @commits.any?
- %h4 Nothing to merge
- %p
- Nothing to merge from
- %span.label-branch #{@merge_request.source_branch}
- to
- %span.label-branch #{@merge_request.target_branch}
- %br
- Try to use different branches or push new code.
-
- - if @closes_issues.present? && @merge_request.open?
- .mr-widget-footer
- %span
- %i.fa.fa-check
- Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
- = succeed '.' do
- != gfm(issues_sentence(@closes_issues))
diff --git a/app/views/projects/merge_requests/update.js.haml b/app/views/projects/merge_requests/update.js.haml
deleted file mode 100644
index b4df1d20737468718827d968170df1696c4bb043..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/update.js.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-- if params[:merge_request_context]
- $('.context').html("#{escape_javascript(render partial: 'projects/merge_requests/show/context', locals: { issue: @issue })}");
- $('.context').effect('highlight');
-
- new UsersSelect()
-
- $('select.select2').select2({width: 'resolve', dropdownAutoWidth: true});
- merge_request = new MergeRequest();
diff --git a/app/views/projects/merge_requests/update_branches.js.haml b/app/views/projects/merge_requests/update_branches.js.haml
deleted file mode 100644
index ca21b3bc0deb365c4db2f3ecc72576c80cd5e4e4..0000000000000000000000000000000000000000
--- a/app/views/projects/merge_requests/update_branches.js.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-:plain
- $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}");
-
- $('select.target_branch').select2({
- width: 'resolve',
- dropdownAutoWidth: true
- });
-
- $(".mr_target_commit").html("");
diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml
deleted file mode 100644
index 95b7070ce5c55396029bba3488f64917e8741f6d..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_form.html.haml
+++ /dev/null
@@ -1,54 +0,0 @@
-%h3.page-title= @milestone.new_record? ? "New Milestone" : "Edit Milestone ##{@milestone.iid}"
-.back-link
- = link_to namespace_project_milestones_path(@project.namespace, @project) do
- ← To milestones
-
-%hr
-
-= form_for [@project.namespace.becomes(Namespace), @project, @milestone], html: {class: 'form-horizontal milestone-form gfm-form'} do |f|
- -if @milestone.errors.any?
- .alert.alert-danger
- %ul
- - @milestone.errors.full_messages.each do |msg|
- %li= msg
- .row
- .col-md-6
- .form-group
- = f.label :title, "Title", class: "control-label"
- .col-sm-10
- = f.text_field :title, maxlength: 255, class: "form-control"
- %p.hint Required
- .form-group.milestone-description
- = f.label :description, "Description", class: "control-label"
- .col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
- = render 'projects/zen', f: f, attr: :description, classes: 'description form-control'
- .hint
- .pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
- .pull-left Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
- .clearfix
- .error-alert
- .col-md-6
- .form-group
- = f.label :due_date, "Due Date", class: "control-label"
- .col-sm-10= f.hidden_field :due_date
- .col-sm-10
- .datepicker
-
- .form-actions
- - if @milestone.new_record?
- = f.submit 'Create milestone', class: "btn-create btn"
- = link_to "Cancel", namespace_project_milestones_path(@project.namespace, @project), class: "btn btn-cancel"
- -else
- = f.submit 'Save changes', class: "btn-save btn"
- = link_to "Cancel", namespace_project_milestone_path(@project.namespace, @project, @milestone), class: "btn btn-cancel"
-
-
-:javascript
- disableButtonIfEmptyField("#milestone_title", ".btn-save");
- $( ".datepicker" ).datepicker({
- dateFormat: "yy-mm-dd",
- onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) }
- }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val()));
-
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
diff --git a/app/views/projects/milestones/_issue.html.haml b/app/views/projects/milestones/_issue.html.haml
deleted file mode 100644
index 88fccfe4981c4e665c299729080f7b37fa2a85ab..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_issue.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-%li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid, 'data-url' => issue_path(issue) }
- .pull-right.assignee-icon
- - if issue.assignee
- = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16", alt: ''
- %span
- = link_to [@project.namespace.becomes(Namespace), @project, issue] do
- %span.cgray ##{issue.iid}
- = link_to_gfm issue.title, [@project.namespace.becomes(Namespace), @project, issue], title: issue.title
-
diff --git a/app/views/projects/milestones/_issues.html.haml b/app/views/projects/milestones/_issues.html.haml
deleted file mode 100644
index 6e4df75a3dfaf3534a601c3566265074d799bed4..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_issues.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.panel.panel-default
- .panel-heading= title
- %ul{ class: "well-list issues-sortable-list", id: "issues-list-#{id}", "data-state" => id }
- - issues.sort_by(&:position).each do |issue|
- = render 'issue', issue: issue
- %li.light.ui-sort-disabled Drag and drop available
diff --git a/app/views/projects/milestones/_merge_request.html.haml b/app/views/projects/milestones/_merge_request.html.haml
deleted file mode 100644
index 0d7a118569a8943037af86bbadf8dd745cb799e8..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_merge_request.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%li{ id: dom_id(merge_request, 'sortable'), class: 'mr-row', 'data-iid' => merge_request.iid, 'data-url' => merge_request_path(merge_request) }
- %span.str-truncated
- = link_to [@project.namespace.becomes(Namespace), @project, merge_request] do
- %span.cgray ##{merge_request.iid}
- = link_to_gfm merge_request.title, [@project.namespace.becomes(Namespace), @project, merge_request], title: merge_request.title
- .pull-right.assignee-icon
- - if merge_request.assignee
- = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16", alt: ''
diff --git a/app/views/projects/milestones/_merge_requests.html.haml b/app/views/projects/milestones/_merge_requests.html.haml
deleted file mode 100644
index 00889a5eb248e90cd25a933b380bf278e8dca804..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_merge_requests.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.panel.panel-default
- .panel-heading= title
- %ul{ class: "well-list merge_requests-sortable-list", id: "merge_requests-list-#{id}", "data-state" => id }
- - merge_requests.sort_by(&:position).each do |merge_request|
- = render 'merge_request', merge_request: merge_request
- %li.light.ui-sort-disabled Drag and drop available
diff --git a/app/views/projects/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml
deleted file mode 100644
index 62360158ff94330e00fdd38394cb300bd7c16f76..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/_milestone.html.haml
+++ /dev/null
@@ -1,24 +0,0 @@
-%li{class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: dom_id(milestone) }
- .pull-right
- - if can?(current_user, :admin_milestone, milestone.project) and milestone.active?
- = link_to edit_namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), class: "btn btn-sm edit-milestone-link btn-grouped" do
- %i.fa.fa-pencil-square-o
- Edit
- = link_to 'Close Milestone', namespace_project_milestone_path(@project.namespace, @project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-sm btn-close"
- %h4
- = link_to_gfm truncate(milestone.title, length: 100), namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone)
- - if milestone.expired? and not milestone.closed?
- %span.cred (Expired)
- %small
- = milestone.expires_at
- .row
- .col-sm-6
- = link_to namespace_project_issues_path(milestone.project.namespace, milestone.project, milestone_id: milestone.id) do
- = pluralize milestone.issues.count, 'Issue'
-
- = link_to namespace_project_merge_requests_path(milestone.project.namespace, milestone.project, milestone_id: milestone.id) do
- = pluralize milestone.merge_requests.count, 'Merge Request'
-
- %span.light #{milestone.percent_complete}% complete
- .col-sm-6
- = milestone_progress_bar(milestone)
diff --git a/app/views/projects/milestones/edit.html.haml b/app/views/projects/milestones/edit.html.haml
deleted file mode 100644
index b1bc3ba0eba684a146b503fa89225bda4614e840..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/edit.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "form"
diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml
deleted file mode 100644
index d3eab8d6d7509d19cb1bba0bda2959999fc5974c..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/index.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-.pull-right
- - if can? current_user, :admin_milestone, @project
- = link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "pull-right btn btn-new", title: "New Milestone" do
- %i.fa.fa-plus
- New Milestone
-= render 'shared/milestones_filter'
-
-.milestones
- .panel.panel-default
- %ul.well-list
- = render @milestones
-
- - if @milestones.blank?
- %li
- .nothing-here-block No milestones to show
-
- = paginate @milestones, theme: "gitlab"
diff --git a/app/views/projects/milestones/new.html.haml b/app/views/projects/milestones/new.html.haml
deleted file mode 100644
index b1bc3ba0eba684a146b503fa89225bda4614e840..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/new.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render "form"
diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
deleted file mode 100644
index 25cc00309658282dd2b31ce9c5942676f76fdd60..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/show.html.haml
+++ /dev/null
@@ -1,103 +0,0 @@
-%h4.page-title
- .issue-box{ class: issue_box_class(@milestone) }
- - if @milestone.closed?
- Closed
- - elsif @milestone.expired?
- Expired
- - else
- Open
- Milestone ##{@milestone.iid}
- %small.creator
- = @milestone.expires_at
- .pull-right
- - if can?(current_user, :admin_milestone, @project)
- = link_to edit_namespace_project_milestone_path(@project.namespace, @project, @milestone), class: "btn btn-grouped" do
- %i.fa.fa-pencil-square-o
- Edit
- - if @milestone.active?
- = link_to 'Close Milestone', namespace_project_milestone_path(@project.namespace, @project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-close btn-grouped"
- - else
- = link_to 'Reopen Milestone', namespace_project_milestone_path(@project.namespace, @project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-reopen btn-grouped"
-
-%hr
-- if @milestone.issues.any? && @milestone.can_be_closed?
- .alert.alert-success
- %span All issues for this milestone are closed. You may close milestone now.
-
-%h3.issue-title
- = gfm escape_once(@milestone.title)
-%div
- - if @milestone.description.present?
- .description
- .wiki
- = preserve do
- = markdown @milestone.description
-
-%hr
-.context
- %p.lead
- Progress:
- #{@milestone.closed_items_count} closed
- –
- #{@milestone.open_items_count} open
-
- %span.light #{@milestone.percent_complete}% complete
- %span.pull-right= @milestone.expires_at
- = milestone_progress_bar(@milestone)
-
-
-%ul.nav.nav-tabs
- %li.active
- = link_to '#tab-issues', 'data-toggle' => 'tab' do
- Issues
- %span.badge= @issues.count
- %li
- = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do
- Merge Requests
- %span.badge= @merge_requests.count
- %li
- = link_to '#tab-participants', 'data-toggle' => 'tab' do
- Participants
- %span.badge= @users.count
-
- - if @project.issues_enabled
- .pull-right
- = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { milestone_id: @milestone.id }), class: "btn btn-grouped", title: "New Issue" do
- %i.fa.fa-plus
- New Issue
- = link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link btn-grouped"
-
-.tab-content
- .tab-pane.active#tab-issues
- .row
- .col-md-4
- = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned, id: 'unassigned')
- .col-md-4
- = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned, id: 'ongoing')
- .col-md-4
- = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed, id: 'closed')
-
- .tab-pane#tab-merge-requests
- .row
- .col-md-3
- = render('merge_requests', title: 'Work in progress (open and unassigned)', merge_requests: @merge_requests.opened.unassigned, id: 'unassigned')
- .col-md-3
- = render('merge_requests', title: 'Waiting for merge (open and assigned)', merge_requests: @merge_requests.opened.assigned, id: 'ongoing')
- .col-md-3
- = render('merge_requests', title: 'Declined (closed)', merge_requests: @merge_requests.declined, id: 'closed')
- .col-md-3
- .panel.panel-primary
- .panel-heading Merged
- %ul.well-list
- - @merge_requests.merged.each do |merge_request|
- = render 'merge_request', merge_request: merge_request
-
- .tab-pane#tab-participants
- %ul.bordered-list
- - @users.each do |user|
- %li
- = link_to user, title: user.name, class: "darken" do
- = image_tag avatar_icon(user.email, 32), class: "avatar s32"
- %strong= truncate(user.name, lenght: 40)
- %br
- %small.cgray= user.username
diff --git a/app/views/projects/milestones/update.js.haml b/app/views/projects/milestones/update.js.haml
deleted file mode 100644
index 3ff84915e97f052a7e833a6812ae0d17b621d8df..0000000000000000000000000000000000000000
--- a/app/views/projects/milestones/update.js.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-:plain
- $('##{dom_id(@milestone)}').fadeOut();
diff --git a/app/views/projects/network/_head.html.haml b/app/views/projects/network/_head.html.haml
deleted file mode 100644
index 415c98ec6a6aed0561730427d782f8db9e48a344..0000000000000000000000000000000000000000
--- a/app/views/projects/network/_head.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-.append-bottom-20
- = render partial: 'shared/ref_switcher', locals: {destination: 'graph'}
- .pull-right.visible-lg.light You can move around the graph by using the arrow keys.
diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml
deleted file mode 100644
index c36bad1e94b6096af8c2e0b0b056aec3e330a6d2..0000000000000000000000000000000000000000
--- a/app/views/projects/network/show.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-= render "head"
-.project-network
- .controls
- = form_tag namespace_project_network_path(@project.namespace, @project, @id), method: :get, class: 'form-inline network-form' do |f|
- = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: 'search-input form-control input-mx-250 search-sha'
- = button_tag class: 'btn btn-success btn-search-sha' do
- %i.fa.fa-search
- .inline.prepend-left-20
- .checkbox.light
- = label_tag :filter_ref do
- = check_box_tag :filter_ref, 1, @options[:filter_ref]
- %span Begin with the selected commit
-
- .network-graph
- = spinner nil, true
-
-:javascript
- disableButtonIfEmptyField('#extended_sha1', '.btn-search-sha')
-
- network_graph = new Network({
- url: '#{namespace_project_network_path(@project.namespace, @project, @ref, @options.merge(format: :json))}',
- commit_url: '#{namespace_project_commit_path(@project.namespace, @project, 'ae45ca32').gsub("ae45ca32", "%s")}',
- ref: '#{@ref}',
- commit_id: '#{@commit.id}'
- })
- new ShortcutsNetwork(network_graph.branch_graph)
diff --git a/app/views/projects/network/show.json.erb b/app/views/projects/network/show.json.erb
deleted file mode 100644
index dc82adcb2c640fd6c9da4208cfead0926eb9b302..0000000000000000000000000000000000000000
--- a/app/views/projects/network/show.json.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<% self.formats = ["html"] %>
-
-<%= raw(
- {
- days: @graph.days.compact.map { |d| [d.day, d.strftime("%b")] },
- commits: @graph.commits.map do |c|
- {
- parents: parents_zip_spaces(c.parents(@graph.map), c.parent_spaces),
- author: {
- name: c.author_name,
- email: c.author_email,
- icon: avatar_icon(c.author_email, 20)
- },
- time: c.time,
- space: c.spaces.first,
- refs: get_refs(@graph.repo, c),
- id: c.sha,
- date: c.date,
- message: c.message,
- }
- end
- }.to_json
-) %>
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
deleted file mode 100644
index a06c85b4251261b4934628cd4bac968224c9d966..0000000000000000000000000000000000000000
--- a/app/views/projects/new.html.haml
+++ /dev/null
@@ -1,120 +0,0 @@
-.project-edit-container
- .project-edit-errors
- = render 'projects/errors'
- .project-edit-content
-
- = form_for @project, html: { class: 'new_project form-horizontal' } do |f|
- .form-group.project-name-holder
- = f.label :path, class: 'control-label' do
- %strong Project path
- .col-sm-10
- .input-group
- = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true
- .input-group-addon
- \.git
-
- - if current_user.can_select_namespace?
- .form-group
- = f.label :namespace_id, class: 'control-label' do
- %span Namespace
- .col-sm-10
- = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2}
-
- %hr
-
- .project-import.js-toggle-container
- .form-group
- %label.control-label Import project from
- .col-sm-10
- - if github_import_enabled?
- = link_to status_import_github_path, class: 'btn' do
- %i.fa.fa-github
- GitHub
- - else
- = link_to '#', class: 'how_to_import_link light btn' do
- %i.fa.fa-github
- GitHub
- = render 'github_import_modal'
-
-
- - if bitbucket_import_enabled?
- = link_to status_import_bitbucket_path, class: 'btn' do
- %i.fa.fa-bitbucket
- Bitbucket
- - else
- = link_to '#', class: 'how_to_import_link light btn' do
- %i.fa.fa-bitbucket
- Bitbucket
- = render 'bitbucket_import_modal'
-
- - unless request.host == 'gitlab.com'
- - if gitlab_import_enabled?
- = link_to status_import_gitlab_path, class: 'btn' do
- %i.fa.fa-heart
- GitLab.com
- - else
- = link_to '#', class: 'how_to_import_link light btn' do
- %i.fa.fa-heart
- GitLab.com
- = render 'gitlab_import_modal'
-
- = link_to new_import_gitorious_path, class: 'btn' do
- %i.icon-gitorious.icon-gitorious-small
- Gitorious.org
-
- = link_to new_import_google_code_path, class: 'btn' do
- %i.fa.fa-google
- Google Code
-
- = link_to "#", class: 'btn js-toggle-button' do
- %i.fa.fa-git
- %span Any repo by URL
-
- .js-toggle-content.hide
- .form-group.import-url-data
- = f.label :import_url, class: 'control-label' do
- %span Git repository URL
- .col-sm-10
- = f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
- .well.prepend-top-20
- %ul
- %li
- The repository must be accessible over HTTP(S). If it is not publicly accessible, you can add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git.
- %li
- The import will time out after 4 minutes. For big repositories, use a clone/push combination.
- %li
- To migrate an SVN repository, check out #{link_to "this document", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}.
-
- %hr.prepend-botton-10
-
- .form-group
- = f.label :description, class: 'control-label' do
- Description
- %span.light (optional)
- .col-sm-10
- = f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250, tabindex: 3
- = render "visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
-
- .form-actions
- = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
-
- - if current_user.can_create_group?
- .pull-right
- .light
- Need a group for several dependent projects?
- = link_to new_group_path, class: "btn btn-xs" do
- Create a group
-
-.save-project-loader.hide
- .center
- %h2
- %i.fa.fa-spinner.fa-spin
- Creating project & repository.
- %p Please wait a moment, this page will automatically refresh when ready.
-
-:coffeescript
- $('.how_to_import_link').bind 'click', (e) ->
- e.preventDefault()
- import_modal = $(this).next(".modal").show()
- $('.modal-header .close').bind 'click', ->
- $(".modal").hide()
diff --git a/app/views/projects/no_repo.html.haml b/app/views/projects/no_repo.html.haml
deleted file mode 100644
index 720957e8336a1cc4ec51c05fdc0dce7ef7e1eeda..0000000000000000000000000000000000000000
--- a/app/views/projects/no_repo.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-%h2
- %i.fa.fa-warning
- No repository
-
-%p.slead
- The repository for this project does not exist.
- %br
- This means you can not push code until you create an empty repository or import existing one.
-%hr
-
-.no-repo-actions
- = link_to namespace_project_repository_path(@project.namespace, @project), method: :post, class: 'btn btn-primary' do
- Create empty bare repository
-
- %strong.prepend-left-10.append-right-10 or
-
- = link_to new_namespace_project_import_path(@project.namespace, @project), class: 'btn' do
- Import repository
-
-- if can? current_user, :remove_project, @project
- .prepend-top-20
- = link_to 'Remove project', project_path(@project), data: { confirm: remove_project_message(@project)}, method: :delete, class: "btn btn-remove pull-right"
diff --git a/app/views/projects/notes/_commit_discussion.html.haml b/app/views/projects/notes/_commit_discussion.html.haml
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/app/views/projects/notes/_diff_notes_with_reply.html.haml b/app/views/projects/notes/_diff_notes_with_reply.html.haml
deleted file mode 100644
index c731baf0a651e225be51be50b74787999a2eb3f1..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_diff_notes_with_reply.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- note = notes.first # example note
--# Check if line want not changed since comment was left
-- if !defined?(line) || line == note.diff_line
- %tr.notes_holder
- %td.notes_line{ colspan: 2 }
- %span.discussion-notes-count
- %i.fa.fa-comment
- = notes.count
- %td.notes_content
- %ul.notes{ rel: note.discussion_id }
- = render notes
- .discussion-reply-holder
- = link_to_reply_diff(note)
diff --git a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml b/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml
deleted file mode 100644
index 789f3e19fd2ec6378a110c64eea201aeb9e0385e..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-- note1 = notes1.present? ? notes1.first : nil
-- note2 = notes2.present? ? notes2.first : nil
-
-%tr.notes_holder
- - if note1
- %td.notes_line
- %span.btn.disabled
- %i.fa.fa-comment
- = notes1.count
- %td.notes_content.parallel
- %ul.notes{ rel: note1.discussion_id }
- = render notes1
-
- .discussion-reply-holder
- = link_to_reply_diff(note1)
- - else
- %td= ""
- %td= ""
-
- - if note2
- %td.notes_line
- %span.btn.disabled
- %i.fa.fa-comment
- = notes2.count
- %td.notes_content.parallel
- %ul.notes{ rel: note2.discussion_id }
- = render notes2
-
- .discussion-reply-holder
- = link_to_reply_diff(note2)
- - else
- %td= ""
- %td= ""
-
diff --git a/app/views/projects/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml
deleted file mode 100644
index b8068835b3ace9eb47c059def33c55d7b4fd9414..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_discussion.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- note = discussion_notes.first
-.timeline-entry
- .timeline-entry-inner
- .timeline-icon
- = link_to user_path(note.author) do
- = image_tag avatar_icon(note.author_email), class: "avatar s40"
- .timeline-content
- - if note.for_merge_request?
- - (active_notes, outdated_notes) = discussion_notes.partition(&:active?)
- = render "projects/notes/discussions/active", discussion_notes: active_notes if active_notes.length > 0
- = render "projects/notes/discussions/outdated", discussion_notes: outdated_notes if outdated_notes.length > 0
- - else
- = render "projects/notes/discussions/commit", discussion_notes: discussion_notes
diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml
deleted file mode 100644
index acb3991d2946a523d3d8e8b88ce48e4f6cbef87a..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_edit_form.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-.note-edit-form
- = form_for note, url: namespace_project_note_path(@project.namespace, @project, note), method: :put, remote: true, authenticity_token: true do |f|
- = note_target_fields(note)
- = render layout: 'projects/md_preview', locals: { preview_class: "note-text" } do
- = render 'projects/zen', f: f, attr: :note,
- classes: 'note_text js-note-text'
-
- .comment-hints.clearfix
- .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }}
- .pull-right Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }.
-
- .note-form-actions
- .buttons
- = f.submit 'Save Comment', class: "btn btn-primary btn-save btn-grouped js-comment-button"
- = link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel"
\ No newline at end of file
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
deleted file mode 100644
index 2ada6cb6700dd11ead463d53b154fa8327bf9ee7..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_form.html.haml
+++ /dev/null
@@ -1,24 +0,0 @@
-= form_for [@project.namespace.becomes(Namespace), @project, @note], remote: true, html: { :'data-type' => 'json', multipart: true, id: nil, class: "new_note js-new-note-form common-note-form gfm-form" }, authenticity_token: true do |f|
- = note_target_fields(@note)
- = f.hidden_field :commit_id
- = f.hidden_field :line_code
- = f.hidden_field :noteable_id
- = f.hidden_field :noteable_type
-
- = render layout: 'projects/md_preview', locals: { preview_class: "note-text" } do
- = render 'projects/zen', f: f, attr: :note,
- classes: 'note_text js-note-text'
-
- .comment-hints.clearfix
- .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }}
- .pull-right Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }.
- .error-alert
-
- .note-form-actions
- .buttons
- = f.submit 'Add Comment', class: "btn comment-btn btn-grouped js-comment-button"
- = yield(:note_actions)
- %a.btn.grouped.js-close-discussion-note-form Cancel
-
-:javascript
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
diff --git a/app/views/projects/notes/_form_errors.html.haml b/app/views/projects/notes/_form_errors.html.haml
deleted file mode 100644
index 0b68bf243f058fea0dded49389a94c97ea91e002..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_form_errors.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-.error-message.js-errors
- - note.errors.full_messages.each do |msg|
- %div= msg
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
deleted file mode 100644
index 0728f8fa42b878105376b18ad868cb4a687ba69e..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_note.html.haml
+++ /dev/null
@@ -1,71 +0,0 @@
-%li.timeline-entry{ id: dom_id(note), class: [dom_class(note), "note-row-#{note.id}", ('system-note' if note.system)], data: { discussion: note.discussion_id } }
- .timeline-entry-inner
- .timeline-icon
- - if note.system
- %span.fa.fa-circle
- - else
- = link_to user_path(note.author) do
- = image_tag avatar_icon(note.author_email), class: "avatar s40", alt: ''
- .timeline-content
- .note-header
- .note-actions
- = link_to "##{dom_id(note)}", name: dom_id(note) do
- %i.fa.fa-link
- Link here
-
- - if can?(current_user, :admin_note, note) && note.editable?
- = link_to "#", title: "Edit comment", class: "js-note-edit" do
- %i.fa.fa-pencil-square-o
- Edit
-
- = link_to namespace_project_note_path(@project.namespace, @project, note), title: "Remove comment", method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: "danger js-note-delete" do
- %i.fa.fa-trash-o.cred
- Remove
- - if note.system
- = link_to user_path(note.author) do
- = image_tag avatar_icon(note.author_email), class: "avatar s16", alt: ''
- = link_to_member(@project, note.author, avatar: false)
- %span.author-username
- = '@' + note.author.username
- %span.note-last-update
- = note_timestamp(note)
-
- - if note.superceded?(@notes)
- - if note.upvote?
- %span.vote.upvote.label.label-gray.strikethrough
- %i.fa.fa-thumbs-up
- \+1
- - if note.downvote?
- %span.vote.downvote.label.label-gray.strikethrough
- %i.fa.fa-thumbs-down
- \-1
- - else
- - if note.upvote?
- %span.vote.upvote.label.label-success
- %i.fa.fa-thumbs-up
- \+1
- - if note.downvote?
- %span.vote.downvote.label.label-danger
- %i.fa.fa-thumbs-down
- \-1
-
-
- .note-body
- .note-text
- = preserve do
- = markdown(note.note, {no_header_anchors: true})
- = render 'projects/notes/edit_form', note: note
-
- - if note.attachment.url
- .note-attachment
- - if note.attachment.image?
- = link_to note.attachment.url, target: '_blank' do
- = image_tag note.attachment.url, class: 'note-image-attach'
- .attachment
- = link_to note.attachment.url, target: "_blank" do
- %i.fa.fa-paperclip
- = note.attachment_identifier
- = link_to delete_attachment_namespace_project_note_path(@project.namespace, @project, note),
- title: "Delete this attachment", method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: "danger js-note-attachment-delete" do
- %i.fa.fa-trash-o.cred
- .clear
diff --git a/app/views/projects/notes/_notes.html.haml b/app/views/projects/notes/_notes.html.haml
deleted file mode 100644
index ca60dd239b234033e6106d5466ce86689ba83d52..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_notes.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-- if @discussions.present?
- - @discussions.each do |discussion_notes|
- - note = discussion_notes.first
- - if note_for_main_target?(note)
- = render discussion_notes
- - else
- = render 'projects/notes/discussion', discussion_notes: discussion_notes
-- else
- - @notes.each do |note|
- - next unless note.author
- = render note
diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml
deleted file mode 100644
index 813e37276bdd8ec5fda2bad1f678a64069bedb25..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/_notes_with_form.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%ul#notes-list.notes.main-notes-list.timeline
- = render "projects/notes/notes"
-.js-notes-busy
-
-.js-main-target-form
-- if can? current_user, :write_note, @project
- = render "projects/notes/form"
-
-:javascript
- new Notes("#{namespace_project_notes_path(namespace_id: @project.namespace, target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i})
diff --git a/app/views/projects/notes/discussions/_active.html.haml b/app/views/projects/notes/discussions/_active.html.haml
deleted file mode 100644
index 7c6f72431730a42361fa2225df776aaed3e4bf68..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/discussions/_active.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-- note = discussion_notes.first
-.discussion.js-toggle-container{ class: note.discussion_id }
- .discussion-header
- .discussion-actions
- = link_to "#", class: "js-toggle-button" do
- %i.fa.fa-chevron-up
- Show/hide discussion
- %div
- = link_to_member(@project, note.author, avatar: false)
- started a discussion
- = link_to diffs_namespace_project_merge_request_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) do
- %strong on the diff
- .last-update.hide.js-toggle-content
- - last_note = discussion_notes.last
- last updated by
- = link_to_member(@project, last_note.author, avatar: false)
- %span.discussion-last-update
- #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
- .discussion-body.js-toggle-content
- = render "projects/notes/discussions/diff", discussion_notes: discussion_notes, note: note
diff --git a/app/views/projects/notes/discussions/_commit.html.haml b/app/views/projects/notes/discussions/_commit.html.haml
deleted file mode 100644
index 62609cfc1c8858d395a2e91b61c0921aaf0d7606..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/discussions/_commit.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-- note = discussion_notes.first
-.discussion.js-toggle-container{ class: note.discussion_id }
- .discussion-header
- .discussion-actions
- = link_to "#", class: "js-toggle-button" do
- %i.fa.fa-chevron-up
- Show/hide discussion
- %div
- = link_to_member(@project, note.author, avatar: false)
- started a discussion on commit
- = link_to(note.noteable.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable), class: 'monospace')
- .last-update.hide.js-toggle-content
- - last_note = discussion_notes.last
- last updated by
- = link_to_member(@project, last_note.author, avatar: false)
- %span.discussion-last-update
- #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
- .discussion-body.js-toggle-content
- - if note.for_diff_line?
- = render "projects/notes/discussions/diff", discussion_notes: discussion_notes, note: note
- - else
- .panel.panel-default
- .notes{ rel: discussion_notes.first.discussion_id }
- = render discussion_notes
- .discussion-reply-holder
- = link_to_reply_diff(discussion_notes.first)
-
diff --git a/app/views/projects/notes/discussions/_diff.html.haml b/app/views/projects/notes/discussions/_diff.html.haml
deleted file mode 100644
index 711aa39101b865a3c1008ba8b89c40b1d68f74e4..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/discussions/_diff.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-- diff = note.diff
-- if diff
- .diff-file
- .diff-header
- %span
- - if diff.deleted_file
- = diff.old_path
- - else
- = diff.new_path
- - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
- %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}"
- .diff-content
- %table
- - note.truncated_diff_lines.each do |line|
- - line_code = generate_line_code(note.file_path, line)
- %tr.line_holder{ id: line_code }
- - if line.type == "match"
- %td.old_line= "..."
- %td.new_line= "..."
- %td.line_content.matched= line.text
- - else
- %td.old_line{class: line.type == "new" ? "new" : "old"}
- = raw(line.type == "new" ? " " : line.old_pos)
- %td.new_line{class: line.type == "new" ? "new" : "old"}
- = raw(line.type == "old" ? " " : line.new_pos)
- %td.line_content{class: "noteable_line #{line.type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text)
-
- - if line_code == note.line_code
- = render "projects/notes/diff_notes_with_reply", notes: discussion_notes
diff --git a/app/views/projects/notes/discussions/_outdated.html.haml b/app/views/projects/notes/discussions/_outdated.html.haml
deleted file mode 100644
index 52a1d342f55059f6be65b5089027ec4335664be8..0000000000000000000000000000000000000000
--- a/app/views/projects/notes/discussions/_outdated.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-- note = discussion_notes.first
-.discussion.js-toggle-container{ class: note.discussion_id }
- .discussion-header
- .discussion-actions
- = link_to "#", class: "js-toggle-button" do
- %i.fa.fa-chevron-down
- Show/hide discussion
- %div
- = link_to_member(@project, note.author, avatar: false)
- started a discussion on the
- %strong outdated diff
- %div
- - last_note = discussion_notes.last
- last updated by
- = link_to_member(@project, last_note.author, avatar: false)
- %span.discussion-last-update
- #{time_ago_with_tooltip(last_note.updated_at, 'bottom', 'discussion_updated_ago')}
- .discussion-body.js-toggle-content.hide
- = render "projects/notes/discussions/diff", discussion_notes: discussion_notes, note: note
diff --git a/app/views/projects/project_members/_group_members.html.haml b/app/views/projects/project_members/_group_members.html.haml
deleted file mode 100644
index 43e92437cf577e64163efd308ca0526e86c3f1ac..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/_group_members.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-.panel.panel-default
- .panel-heading
- %strong #{@group.name}
- group members
- %small
- (#{members.count})
- .panel-head-actions
- = link_to group_group_members_path(@group), class: 'btn btn-sm' do
- %i.fa.fa-pencil-square-o
- Edit group members
- %ul.well-list
- - members.each do |member|
- = render 'groups/group_members/group_member', member: member, show_controls: false
- - if members.count > 20
- %li
- and #{members.count - 20} more. For full list visit #{link_to 'group members page', group_group_members_path(@group)}
diff --git a/app/views/projects/project_members/_new_project_member.html.haml b/app/views/projects/project_members/_new_project_member.html.haml
deleted file mode 100644
index d708b01a114873fda0195d43cc4cf09d29a45018..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/_new_project_member.html.haml
+++ /dev/null
@@ -1,18 +0,0 @@
-= form_for @project_member, as: :project_member, url: namespace_project_project_members_path(@project.namespace, @project), html: { class: 'form-horizontal users-project-form' } do |f|
- .form-group
- = f.label :user_ids, "People", class: 'control-label'
- .col-sm-10
- = users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true)
- .help-block
- Search for existing users or invite new ones using their email address.
-
- .form-group
- = f.label :access_level, "Project Access", class: 'control-label'
- .col-sm-10
- = select_tag :access_level, options_for_select(ProjectMember.access_roles, @project_member.access_level), class: "project-access-select select2"
- .help-block
- Read more about role permissions
- %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink"
-
- .form-actions
- = f.submit 'Add users to project', class: "btn btn-create"
diff --git a/app/views/projects/project_members/_project_member.html.haml b/app/views/projects/project_members/_project_member.html.haml
deleted file mode 100644
index 635e4d7094173682031c0eb340509efae6dd819d..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/_project_member.html.haml
+++ /dev/null
@@ -1,53 +0,0 @@
-- user = member.user
-- return unless user || member.invite?
-
-%li{class: "#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}", id: dom_id(member)}
- %span.list-item-name
- - if member.user
- = image_tag avatar_icon(user.email, 16), class: "avatar s16", alt: ''
- %strong
- = link_to user.name, user_path(user)
- %span.cgray= user.username
- - if user == current_user
- %span.label.label-success It's you
- - if user.blocked?
- %label.label.label-danger
- %strong Blocked
- - else
- = image_tag avatar_icon(member.invite_email, 16), class: "avatar s16", alt: ''
- %strong
- = member.invite_email
- %span.cgray
- invited
- - if member.created_by
- by
- = link_to member.created_by.name, user_path(member.created_by)
- = time_ago_with_tooltip(member.created_at)
-
- - if current_user_can_admin_project
- = link_to resend_invite_namespace_project_project_member_path(@project.namespace, @project, member), method: :post, class: "btn-xs btn", title: 'Resend invite' do
- Resend invite
-
- - if current_user_can_admin_project
- - unless @project.personal? && user == current_user
- .pull-right
- %strong= member.human_access
- = button_tag class: "btn-xs btn js-toggle-button",
- title: 'Edit access level', type: 'button' do
- %i.fa.fa-pencil-square-o
-
-
- - if current_user == user
- = link_to leave_namespace_project_project_members_path(@project.namespace, @project), data: { confirm: "Leave project?"}, method: :delete, class: "btn-xs btn btn-remove", title: 'Leave project' do
- %i.fa.fa-minus.fa-inverse
- - else
- = link_to namespace_project_project_member_path(@project.namespace, @project, member), data: { confirm: remove_from_project_team_message(@project, member) }, method: :delete, remote: true, class: "btn-xs btn btn-remove", title: 'Remove user from team' do
- %i.fa.fa-minus.fa-inverse
-
- .edit-member.hide.js-toggle-content
- %br
- = form_for member, as: :project_member, url: namespace_project_project_member_path(@project.namespace, @project, member), remote: true do |f|
- .prepend-top-10
- = f.select :access_level, options_for_select(ProjectMember.access_roles, member.access_level), {}, class: 'form-control'
- .prepend-top-10
- = f.submit 'Save', class: 'btn btn-save'
diff --git a/app/views/projects/project_members/_team.html.haml b/app/views/projects/project_members/_team.html.haml
deleted file mode 100644
index 615c425e59ae2967a6ba90f5d7ff6ad8bd83103d..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/_team.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-- can_admin_project = can?(current_user, :admin_project, @project)
-
-.panel.panel-default.prepend-top-20
- .panel-heading
- %strong #{@project.name}
- project members
- %small
- (#{members.count})
- %ul.well-list
- - members.each do |project_member|
- = render 'project_member', member: project_member, current_user_can_admin_project: can_admin_project
diff --git a/app/views/projects/project_members/import.html.haml b/app/views/projects/project_members/import.html.haml
deleted file mode 100644
index 293754cd0c0fa180a5f80dec6fdb78738d88306a..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/import.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%h3.page-title
- Import members from another project
-%p.light
- Only project members will be imported. Group members will be skipped.
-%hr
-= form_tag apply_import_namespace_project_project_members_path(@project.namespace, @project), method: 'post', class: 'form-horizontal' do
- .form-group
- = label_tag :source_project_id, "Project", class: 'control-label'
- .col-sm-10= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "select2 lg", required: true)
-
- .form-actions
- = button_tag 'Import project members', class: "btn btn-create"
- = link_to "Cancel", namespace_project_project_members_path(@project.namespace, @project), class: "btn btn-cancel"
-
diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml
deleted file mode 100644
index 36a6f6a15547d9d05737d5ff08f475a198531dae..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/index.html.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-%h3.page-title
- Users with access to this project
-
-%p.light
- Read more about project permissions
- %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink"
-
-%hr
-
-.clearfix.js-toggle-container
- = form_tag namespace_project_project_members_path(@project.namespace, @project), method: :get, class: 'form-inline member-search-form' do
- .form-group
- = search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input input-mn-300' }
- = button_tag 'Search', class: 'btn'
-
- - if can?(current_user, :admin_project_member, @project)
- %span.pull-right
- = button_tag class: 'btn btn-new btn-grouped js-toggle-button', type: 'button' do
- Add members
- %i.fa.fa-chevron-down
- = link_to import_namespace_project_project_members_path(@project.namespace, @project), class: "btn btn-grouped", title: "Import members from another project" do
- Import members
-
- .js-toggle-content.hide.new-group-member-holder
- = render "new_project_member"
-
-= render "team", members: @project_members
-
-- if @group
- = render "group_members", members: @group_members
-
-:coffeescript
- $('form.member-search-form').on 'submit', (event) ->
- event.preventDefault()
- Turbolinks.visit @.action + '?' + $(@).serialize()
diff --git a/app/views/projects/project_members/update.js.haml b/app/views/projects/project_members/update.js.haml
deleted file mode 100644
index 811b1858821c93518116a449322dc0b161954f77..0000000000000000000000000000000000000000
--- a/app/views/projects/project_members/update.js.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-- can_admin_project = can?(current_user, :admin_project, @project)
-:plain
- $("##{dom_id(@project_member)}").replaceWith('#{escape_javascript(render("project_member", member: @project_member, current_user_can_admin_project: can_admin_project))}');
diff --git a/app/views/projects/protected_branches/_branches_list.html.haml b/app/views/projects/protected_branches/_branches_list.html.haml
deleted file mode 100644
index bb49f4de8736ce2422f605b09c67824ac4ef0040..0000000000000000000000000000000000000000
--- a/app/views/projects/protected_branches/_branches_list.html.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-- unless @branches.empty?
- %br
- %h4 Already Protected:
- %table.table.protected-branches-list
- %thead
- %tr.no-border
- %th Branch
- %th Developers can push
- %th Last commit
- %th
-
- %tbody
- - @branches.each do |branch|
- - @url = namespace_project_protected_branch_path(@project.namespace, @project, branch)
- %tr
- %td
- = link_to namespace_project_commits_path(@project.namespace, @project, branch.name) do
- %strong= branch.name
- - if @project.root_ref?(branch.name)
- %span.label.label-info default
- %td
- = check_box_tag "developers_can_push", branch.id, branch.developers_can_push, "data-url" => @url
- %td
- - if commit = branch.commit
- = link_to namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id' do
- = commit.short_id
- ·
- #{time_ago_with_tooltip(commit.committed_date)}
- - else
- (branch was removed from repository)
- %td
- .pull-right
- - if can? current_user, :admin_project, @project
- = link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-sm"
diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml
deleted file mode 100644
index a3464c0e5e183d623abb99c5372b588349c9aee3..0000000000000000000000000000000000000000
--- a/app/views/projects/protected_branches/index.html.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-%h3.page-title Protected branches
-%p.light Keep stable branches secure and force developers to use Merge Requests
-%hr
-
-.well.append-bottom-20
- %p Protected branches are designed to
- %ul
- %li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
- %li prevent anyone from force pushing to the branch
- %li prevent anyone from deleting the branch
- %p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}
-
-- if can? current_user, :admin_project, @project
- = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f|
- -if @protected_branch.errors.any?
- .alert.alert-danger
- %ul
- - @protected_branch.errors.full_messages.each do |msg|
- %li= msg
-
- .form-group
- = f.label :name, "Branch", class: 'control-label'
- .col-sm-10
- = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2"})
- .form-group
- .col-sm-offset-2.col-sm-10
- .checkbox
- = f.label :developers_can_push do
- = f.check_box :developers_can_push
- %strong Developers can push
- .help-block Allow developers to push to this branch
- .form-actions
- = f.submit 'Protect', class: "btn-create btn"
-= render 'branches_list'
-
diff --git a/app/views/projects/refs/logs_tree.js.haml b/app/views/projects/refs/logs_tree.js.haml
deleted file mode 100644
index 35c15cf3a9ed70f327a1779e104f45c790f13b15..0000000000000000000000000000000000000000
--- a/app/views/projects/refs/logs_tree.js.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-- @logs.each do |content_data|
- - file_name = content_data[:file_name]
- - commit = content_data[:commit]
- - next unless commit
-
- :plain
- var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
- row.find("td.tree_time_ago").html('#{escape_javascript time_ago_with_tooltip(commit.committed_date)}');
- row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}');
-
-- if @logs.present?
- :plain
- var current_url = location.href.replace(/\/?$/, '/');
- var log_url = '#{namespace_project_tree_url(@project.namespace, @project, tree_join(@ref, @path || '/'))}'.replace(/\/?$/, '/');
- if(current_url == log_url) {
- // Load 10 more commit log for each file in tree
- // if we still on the same page
- ajaxGet('#{logs_file_namespace_project_ref_path(@project.namespace, @project, @ref, @path || '', offset: (@offset + @limit))}');
- }
diff --git a/app/views/projects/repositories/_download_archive.html.haml b/app/views/projects/repositories/_download_archive.html.haml
deleted file mode 100644
index b9486a9b49265c92771b58c529b26fd9f51cb4de..0000000000000000000000000000000000000000
--- a/app/views/projects/repositories/_download_archive.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-- ref = ref || nil
-- btn_class = btn_class || ''
-- split_button = split_button || false
-- if split_button == true
- %span.btn-group{class: btn_class}
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn col-xs-10', rel: 'nofollow' do
- %i.fa.fa-download
- %span Download zip
- %a.col-xs-2.btn.dropdown-toggle{ 'data-toggle' => 'dropdown' }
- %span.caret
- %span.sr-only
- Select Archive Format
- %ul.col-xs-10.dropdown-menu{ role: 'menu' }
- %li
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), rel: 'nofollow' do
- %i.fa.fa-download
- %span Download zip
- %li
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.gz'), rel: 'nofollow' do
- %i.fa.fa-download
- %span Download tar.gz
- %li
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.bz2'), rel: 'nofollow' do
- %i.fa.fa-download
- %span Download tar.bz2
- %li
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar'), rel: 'nofollow' do
- %i.fa.fa-download
- %span Download tar
-- else
- %span.btn-group{class: btn_class}
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'zip'), class: 'btn', rel: 'nofollow' do
- %i.fa.fa-download
- %span zip
- = link_to archive_namespace_project_repository_path(@project.namespace, @project, ref: ref, format: 'tar.gz'), class: 'btn', rel: 'nofollow' do
- %i.fa.fa-download
- %span tar.gz
diff --git a/app/views/projects/repositories/_feed.html.haml b/app/views/projects/repositories/_feed.html.haml
deleted file mode 100644
index f3526ad0747a8dbe31117f5e0dd7308efc9c3db1..0000000000000000000000000000000000000000
--- a/app/views/projects/repositories/_feed.html.haml
+++ /dev/null
@@ -1,18 +0,0 @@
-- commit = update
-%tr
- %td
- = link_to namespace_project_commits_path(@project.namespace, @project, commit.head.name) do
- %strong
- = commit.head.name
- - if @project.root_ref?(commit.head.name)
- %span.label default
-
- %td
- %div
- = link_to namespace_project_commits_path(@project.namespace, @project, commit.id) do
- %code= commit.short_id
- = image_tag avatar_icon(commit.author_email), class: "", width: 16, alt: ''
- = gfm escape_once(truncate(commit.title, length: 40))
- %td
- %span.pull-right.cgray
- = time_ago_with_tooltip(commit.committed_date)
diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml
deleted file mode 100644
index ce6b7a0737a8c0fa344687710d8f2d2f0cae0666..0000000000000000000000000000000000000000
--- a/app/views/projects/services/_form.html.haml
+++ /dev/null
@@ -1,106 +0,0 @@
-%h3.page-title
- = @service.title
- = boolean_to_icon @service.activated?
-
-%p= @service.description
-
-.back-link
- = link_to namespace_project_services_path(@project.namespace, @project) do
- ← to services
-
-%hr
-
-= form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |f|
- - if @service.errors.any?
- .alert.alert-danger
- %ul
- - @service.errors.full_messages.each do |msg|
- %li= msg
-
- - if @service.help.present?
- .well
- = preserve do
- = markdown @service.help
-
- .form-group
- = f.label :active, "Active", class: "control-label"
- .col-sm-10
- = f.check_box :active
-
- - if @service.supported_events.length > 1
- .form-group
- = f.label :url, "Trigger", class: 'control-label'
- .col-sm-10
- - if @service.supported_events.include?("push")
- %div
- = f.check_box :push_events, class: 'pull-left'
- .prepend-left-20
- = f.label :push_events, class: 'list-label' do
- %strong Push events
- %p.light
- This url will be triggered by a push to the repository
- - if @service.supported_events.include?("tag_push")
- %div
- = f.check_box :tag_push_events, class: 'pull-left'
- .prepend-left-20
- = f.label :tag_push_events, class: 'list-label' do
- %strong Tag push events
- %p.light
- This url will be triggered when a new tag is pushed to the repository
- - if @service.supported_events.include?("note")
- %div
- = f.check_box :note_events, class: 'pull-left'
- .prepend-left-20
- = f.label :note_events, class: 'list-label' do
- %strong Comments
- %p.light
- This url will be triggered when someone adds a comment
- - if @service.supported_events.include?("issue")
- %div
- = f.check_box :issues_events, class: 'pull-left'
- .prepend-left-20
- = f.label :issues_events, class: 'list-label' do
- %strong Issues events
- %p.light
- This url will be triggered when an issue is created
- - if @service.supported_events.include?("merge_request")
- %div
- = f.check_box :merge_requests_events, class: 'pull-left'
- .prepend-left-20
- = f.label :merge_requests_events, class: 'list-label' do
- %strong Merge Request events
- %p.light
- This url will be triggered when a merge request is created
-
- - @service.fields.each do |field|
- - name = field[:name]
- - title = field[:title] || name.humanize
- - value = service_field_value(field[:type], @service.send(name))
- - type = field[:type]
- - placeholder = field[:placeholder]
- - choices = field[:choices]
- - default_choice = field[:default_choice]
- - help = field[:help]
-
- .form-group
- = f.label name, title, class: "control-label"
- .col-sm-10
- - if type == 'text'
- = f.text_field name, class: "form-control", placeholder: placeholder
- - elsif type == 'textarea'
- = f.text_area name, rows: 5, class: "form-control", placeholder: placeholder
- - elsif type == 'checkbox'
- = f.check_box name
- - elsif type == 'select'
- = f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
- - elsif type == 'password'
- = f.password_field name, placeholder: value, class: 'form-control'
- - if help
- %span.help-block= help
-
- .form-actions
- = f.submit 'Save', class: 'btn btn-save'
-
- - if @service.valid? && @service.activated?
- - disabled = @service.can_test? ? '':'disabled'
- = link_to 'Test settings', test_namespace_project_service_path(@project.namespace, @project, @service.to_param), class: "btn #{disabled}"
diff --git a/app/views/projects/services/edit.html.haml b/app/views/projects/services/edit.html.haml
deleted file mode 100644
index bcc5832792fea10b70d29a9fb15633f06e001dd0..0000000000000000000000000000000000000000
--- a/app/views/projects/services/edit.html.haml
+++ /dev/null
@@ -1 +0,0 @@
-= render 'form'
diff --git a/app/views/projects/services/index.html.haml b/app/views/projects/services/index.html.haml
deleted file mode 100644
index 0d3ccb6bb839e7306e5b9409fee7e309d11eea3e..0000000000000000000000000000000000000000
--- a/app/views/projects/services/index.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-%h3.page-title Project services
-%p.light Project services allow you to integrate GitLab with other applications
-
-%table.table
- %thead
- %tr
- %th
- %th Service
- %th Description
- %th Last edit
- - @services.sort_by(&:title).each do |service|
- %tr
- %td
- = boolean_to_icon service.activated?
- %td
- = link_to edit_namespace_project_service_path(@project.namespace, @project, service.to_param) do
- %strong= service.title
- %td
- = service.description
- %td.light
- = time_ago_in_words service.updated_at
- ago
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
deleted file mode 100644
index 4464c51744aa77199b331d8effc9293ffbc8027a..0000000000000000000000000000000000000000
--- a/app/views/projects/show.html.haml
+++ /dev/null
@@ -1,108 +0,0 @@
-- if current_user && can?(current_user, :download_code, @project)
- = render 'shared/no_ssh'
- = render 'shared/no_password'
-
-= render "home_panel"
-
-%ul.nav.nav-tabs
- %li.active
- = link_to '#tab-activity', 'data-toggle' => 'tab' do
- Activity
- - if @repository.readme
- %li
- = link_to '#tab-readme', 'data-toggle' => 'tab' do
- Readme
- - if @repository.changelog
- %li
- = link_to changelog_url(@project) do
- Changelog
- - if @repository.contribution_guide
- %li
- = link_to contribution_guide_url(@project) do
- Contribution guide
- - if @repository.license
- %li
- = link_to license_url(@project) do
- License
-
- .project-home-links
- - unless @project.empty_repo?
- = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref)
- = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project)
- = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project)
- %span.light.prepend-left-20= repository_size
-
-.tab-content
- .tab-pane.active#tab-activity
- .row
- = link_to '#aside', class: 'show-aside' do
- %i.fa.fa-angle-left
- %section.col-md-9
- = render "events/event_last_push", event: @last_push
- = render 'shared/event_filter'
- .content_list
- = spinner
- %aside.col-md-3.project-side
- .clearfix
- - if @project.archived?
- .alert.alert-warning
- %h4
- %i.fa.fa-exclamation-triangle
- Archived project!
- %p Repository is read-only
-
- - if @project.forked_from_project
- .well
- %i.fa.fa-code-fork.project-fork-icon
- Forked from:
- %br
- = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
-
- - unless @project.empty_repo?
- = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' do
- %i.fa.fa-exchange
- Compare code
-
- - if can?(current_user, :download_code, @project)
- = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-block'
-
- - if version = @repository.version
- - detail_url = changelog_url(@project) || version_url(@project)
- = link_to detail_url, class: 'btn btn-block' do
- %i.fa.fa-file-text-o
- Version:
- %span.count
- = @repository.blob_by_oid(version.id).data
-
- .prepend-top-10.append-bottom-10
- %p
- %span.light Created on
- #{@project.created_at.stamp('Aug 22, 2013')}
- %p
- %span.light Owned by #{@project.group ? "the" : nil}
- - if @project.group
- #{link_to @project.group.name, @project.group} group
- - else
- #{link_to @project.owner_name, @project.owner}
-
-
- .prepend-top-10
- - @project.ci_services.each do |ci_service|
- - if ci_service.active? && ci_service.respond_to?(:builds_path)
- %hr
- - if ci_service.respond_to?(:status_img_path)
- = link_to ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' do
- = image_tag ci_service.status_img_path, alt: "build status"
- - else
- %span.light CI provided by
- = link_to ci_service.title, ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink'
-
- - if readme = @repository.readme
- .tab-pane#tab-readme
- %article.readme-holder#README
- = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do
- %h4.readme-file-title
- %i.fa.fa-file
- = readme.name
- .wiki
- = render_readme(readme)
diff --git a/app/views/projects/snippets/_snippet.html.haml b/app/views/projects/snippets/_snippet.html.haml
deleted file mode 100644
index b2c35edc44c653e011712dbbb54e26040affeb9a..0000000000000000000000000000000000000000
--- a/app/views/projects/snippets/_snippet.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-%li
- %h4.snippet-title
- = link_to reliable_snippet_path(snippet) do
- = truncate(snippet.title, length: 60)
- %span.cgray.monospace.tiny.pull-right
- = snippet.file_name
-
- .snippet-info
- = "##{snippet.id}"
- %span
- by
- = image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16"
- = snippet.author_name
- %span.light
- #{time_ago_with_tooltip(snippet.created_at)}
diff --git a/app/views/projects/snippets/edit.html.haml b/app/views/projects/snippets/edit.html.haml
deleted file mode 100644
index 2d4d5d030ab3ec37c7601b4dc9d114bfec25621f..0000000000000000000000000000000000000000
--- a/app/views/projects/snippets/edit.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title
- Edit snippet
-%hr
-= render "shared/snippets/form", url: namespace_project_snippet_path(@project.namespace, @project, @snippet)
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml
deleted file mode 100644
index e2d8ec673a17fe3f2e6ced456fbf3d9b5da3ba22..0000000000000000000000000000000000000000
--- a/app/views/projects/snippets/index.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-%h3.page-title
- Snippets
- - if can? current_user, :write_project_snippet, @project
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Snippet" do
- Add new snippet
-
-%p.light
- Share code pastes with others out of git repository
-
-%hr
-%ul.bordered-list
- = render partial: "projects/snippets/snippet", collection: @snippets
- - if @snippets.empty?
- %li
- .nothing-here-block Nothing here.
diff --git a/app/views/projects/snippets/new.html.haml b/app/views/projects/snippets/new.html.haml
deleted file mode 100644
index bb659dba0cf1cb21504f6796f835193055565305..0000000000000000000000000000000000000000
--- a/app/views/projects/snippets/new.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title
- New snippet
-%hr
-= render "shared/snippets/form", url: namespace_project_snippets_path(@project.namespace, @project, @snippet)
diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml
deleted file mode 100644
index d19689a1056213a16988e15c975c09e4c2e4d888..0000000000000000000000000000000000000000
--- a/app/views/projects/snippets/show.html.haml
+++ /dev/null
@@ -1,37 +0,0 @@
-%h3.page-title
- = @snippet.title
-
- .pull-right
- = link_to new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new", title: "New Snippet" do
- Add new snippet
-
-%hr
-
-.append-bottom-20
- .pull-right
- = "##{@snippet.id}"
- %span.light
- by
- = link_to user_path(@snippet.author) do
- = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16"
- = @snippet.author_name
-
- .back-link
- = link_to namespace_project_snippets_path(@project.namespace, @project) do
- ← project snippets
-
-.file-holder
- .file-title
- %i.fa.fa-file
- %strong
- = @snippet.file_name
- .file-actions
- .btn-group
- - if can?(current_user, :modify_project_snippet, @snippet)
- = link_to "edit", edit_namespace_project_snippet_path(@project.namespace, @project, @snippet), class: "btn btn-sm", title: 'Edit Snippet'
- = link_to "raw", raw_namespace_project_snippet_path(@project.namespace, @project, @snippet), class: "btn btn-sm", target: "_blank"
- - if can?(current_user, :admin_project_snippet, @snippet)
- = link_to "remove", namespace_project_snippet_path(@project.namespace, @project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-sm btn-remove", title: 'Delete Snippet'
- = render 'shared/snippets/blob'
-
-%div#notes= render "projects/notes/notes_with_form"
diff --git a/app/views/projects/tags/_tag.html.haml b/app/views/projects/tags/_tag.html.haml
deleted file mode 100644
index 28ad272322ff3c1ada704fec7a8b82da175c1f66..0000000000000000000000000000000000000000
--- a/app/views/projects/tags/_tag.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-- commit = @repository.commit(tag.target)
-%li
- %h4
- = link_to namespace_project_commits_path(@project.namespace, @project, tag.name), class: "" do
- %i.fa.fa-tag
- = tag.name
- - if tag.message.present?
-
- = strip_gpg_signature(tag.message)
- .pull-right
- - if can? current_user, :download_code, @project
- = render 'projects/repositories/download_archive', ref: tag.name, btn_class: 'btn-grouped btn-group-xs'
- - if can?(current_user, :admin_project, @project)
- = link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'btn btn-xs btn-remove remove-row grouped', method: :delete, data: { confirm: 'Removed tag cannot be restored. Are you sure?'}, remote: true do
- %i.fa.fa-trash-o
-
- - if commit
- %ul.list-unstyled
- = render 'projects/commits/inline_commit', commit: commit, project: @project
- - else
- %p
- Cant find HEAD commit for this tag
diff --git a/app/views/projects/tags/destroy.js.haml b/app/views/projects/tags/destroy.js.haml
deleted file mode 100644
index ada6710f940638e963947e871f37fd2e22268b41..0000000000000000000000000000000000000000
--- a/app/views/projects/tags/destroy.js.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-$('.js-totaltags-count').html("#{@repository.tags.size}")
-- if @repository.tags.size == 0
- $('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000)
diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml
deleted file mode 100644
index f1bc2bc9a2b23aa8cfc5526a610b7b4c59bb0c6f..0000000000000000000000000000000000000000
--- a/app/views/projects/tags/index.html.haml
+++ /dev/null
@@ -1,30 +0,0 @@
-= render "projects/commits/head"
-
-%h3.page-title
- Git Tags
- - if can? current_user, :push_code, @project
- .pull-right
- = link_to new_namespace_project_tag_path(@project.namespace, @project), class: 'btn btn-create new-tag-btn' do
- %i.fa.fa-add-sign
- New tag
-
-%p.light
- Tags give the ability to mark specific points in history as being important
-%hr
-
-.tags
- - unless @tags.empty?
- %ul.bordered-list
- - @tags.each do |tag|
- = render 'tag', tag: @repository.find_tag(tag)
-
- = paginate @tags, theme: 'gitlab'
-
- - else
- .nothing-here-block
- Repository has no tags yet.
- %br
- %small
- Use git tag command to add a new one:
- %br
- %span.monospace git tag -a v1.4 -m 'version 1.4'
diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml
deleted file mode 100644
index 655044438d50a412085d3e9e2ee351fefebb8ccb..0000000000000000000000000000000000000000
--- a/app/views/projects/tags/new.html.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-- if @error
- .alert.alert-danger
- %button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
- = @error
-%h3.page-title
- %i.fa.fa-code-fork
- New tag
-= form_tag namespace_project_tags_path, method: :post, id: "new-tag-form", class: "form-horizontal" do
- .form-group
- = label_tag :tag_name, 'Name for new tag', class: 'control-label'
- .col-sm-10
- = text_field_tag :tag_name, params[:tag_name], placeholder: 'v3.0.1', required: true, tabindex: 1, class: 'form-control'
- .form-group
- = label_tag :ref, 'Create from', class: 'control-label'
- .col-sm-10
- = text_field_tag :ref, params[:ref], placeholder: 'master', required: true, tabindex: 2, class: 'form-control'
- .light Branch name or commit SHA
- .form-group
- = label_tag :message, 'Message', class: 'control-label'
- .col-sm-10
- = text_field_tag :message, nil, placeholder: 'Enter message.', required: false, tabindex: 3, class: 'form-control'
- .light (Optional) Entering a message will create an annotated tag.
- .form-actions
- = button_tag 'Create tag', class: 'btn btn-create', tabindex: 3
- = link_to 'Cancel', namespace_project_tags_path(@project.namespace, @project), class: 'btn btn-cancel'
-
-:javascript
- disableButtonIfAnyEmptyField($("#new-tag-form"), ".form-control", ".btn-create");
- var availableTags = #{@project.repository.ref_names.to_json};
-
- $("#ref").autocomplete({
- source: availableTags,
- minLength: 1
- });
diff --git a/app/views/projects/transfer.js.haml b/app/views/projects/transfer.js.haml
deleted file mode 100644
index 17b9fecfeb162f8f3ac88523a7fbe336c4d46516..0000000000000000000000000000000000000000
--- a/app/views/projects/transfer.js.haml
+++ /dev/null
@@ -1,2 +0,0 @@
-:plain
- location.href = "#{edit_namespace_project_path(@project.namespace, @project)}";
diff --git a/app/views/projects/tree/_blob_item.html.haml b/app/views/projects/tree/_blob_item.html.haml
deleted file mode 100644
index 02ecbade219250ceaf038830c7f9da2361a5baba..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_blob_item.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%tr{ class: "tree-item #{tree_hex_class(blob_item)}" }
- %td.tree-item-file-name
- = tree_icon(type, blob_item.mode, blob_item.name)
- %span.str-truncated
- = link_to blob_item.name, namespace_project_blob_path(@project.namespace, @project, tree_join(@id || @commit.id, blob_item.name))
- %td.tree_time_ago.cgray
- = render 'spinner'
- %td.hidden-xs.tree_commit
diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml
deleted file mode 100644
index f082d71186558744fc0eba13427e81659c39c845..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_readme.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%article.readme-holder#README
- = link_to '#README' do
- %h4.readme-file-title
- %i.fa.fa-file
- = readme.name
- .wiki
- = render_readme(readme)
diff --git a/app/views/projects/tree/_spinner.html.haml b/app/views/projects/tree/_spinner.html.haml
deleted file mode 100644
index b47ad0f41e48d63a4ca2ba91d684729b4b47b14d..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_spinner.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%span.log_loading.hide
- %i.fa.fa-spinner.fa-spin
- Loading commit data...
diff --git a/app/views/projects/tree/_submodule_item.html.haml b/app/views/projects/tree/_submodule_item.html.haml
deleted file mode 100644
index 2b5f671c09ec5e4a1e268ecaa20f1578119c650d..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_submodule_item.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%tr{ class: "tree-item" }
- %td.tree-item-file-name
- %i.fa.fa-archive.fa-fw
- = submodule_link(submodule_item, @ref)
- %td
- %td.hidden-xs
diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml
deleted file mode 100644
index d304690d162778ef77965d48cc3739014c69adf5..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_tree.html.haml
+++ /dev/null
@@ -1,53 +0,0 @@
-%ul.breadcrumb.repo-breadcrumb
- %li
- = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
- = @project.path
- - tree_breadcrumbs(tree, 6) do |title, path|
- %li
- - if path
- = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
- - else
- = link_to title, '#'
- - if current_user && can_push_branch?(@project, @ref)
- %li
- = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'New file', id: 'new-file-link' do
- %small
- %i.fa.fa-plus
-
-%div#tree-content-holder.tree-content-holder
- %table#tree-slider{class: "table_#{@hex_path} tree-table" }
- %thead
- %tr
- %th Name
- %th Last Update
- %th.hidden-xs
- .pull-left Last Commit
- .last-commit.hidden-sm.pull-left
-
- %i.fa.fa-angle-right
-
- %small.light
- = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit)
- –
- = truncate(@commit.title, length: 50)
- = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'pull-right'
-
- - if @path.present?
- %tr.tree-item
- %td.tree-item-file-name
- = link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10'
- %td
- %td.hidden-xs
-
- = render_tree(tree)
-
- - if tree.readme
- = render "projects/tree/readme", readme: tree.readme
-
-%div.tree_progress
-
-:javascript
- // Load last commit log for each file in tree
- $('#tree-slider').waitForImages(function() {
- ajaxGet('#{@logs_path}');
- });
diff --git a/app/views/projects/tree/_tree_commit_column.html.haml b/app/views/projects/tree/_tree_commit_column.html.haml
deleted file mode 100644
index 50521264a611c386a9813fb6767d9dca1b4e7f54..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_tree_commit_column.html.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%span.str-truncated
- %span.tree_author= commit_author_link(commit, avatar: true, size: 16)
- = link_to_gfm commit.title, namespace_project_commit_path(@project.namespace, @project, commit.id), class: "tree-commit-link"
diff --git a/app/views/projects/tree/_tree_item.html.haml b/app/views/projects/tree/_tree_item.html.haml
deleted file mode 100644
index e87138bf9800bd7d4349d4b450a6dfb3af741353..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/_tree_item.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-%tr{ class: "tree-item #{tree_hex_class(tree_item)}" }
- %td.tree-item-file-name
- = tree_icon(type, tree_item.mode, tree_item.name)
- %span.str-truncated
- - path = flatten_tree(tree_item)
- = link_to path, namespace_project_tree_path(@project.namespace, @project, tree_join(@id || @commit.id, path))
- %td.tree_time_ago.cgray
- = render 'spinner'
- %td.hidden-xs.tree_commit
diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml
deleted file mode 100644
index feca145369752b8ad9e3758288dd7a33986d1e83..0000000000000000000000000000000000000000
--- a/app/views/projects/tree/show.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.tree-ref-holder
- = render 'shared/ref_switcher', destination: 'tree', path: @path
-
-- if can? current_user, :download_code, @project
- .tree-download-holder
- = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-sm pull-right hidden-xs hidden-sm', split_button: true
-
-#tree-holder.tree-holder.clearfix
- = render "tree", tree: @tree
diff --git a/app/views/projects/update.js.haml b/app/views/projects/update.js.haml
deleted file mode 100644
index 4f3f4cab8d5c7b8df6afbfc79d7715fcd963ca4c..0000000000000000000000000000000000000000
--- a/app/views/projects/update.js.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- if @project.valid?
- :plain
- location.href = "#{edit_namespace_project_path(@project.namespace, @project)}";
-- else
- :plain
- $(".project-edit-errors").html("#{escape_javascript(render('errors'))}");
- $('.save-project-loader').hide();
- $('.project-edit-container').show();
- $('.project-edit-content .btn-save').enableButton();
diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml
deleted file mode 100644
index 9fbfa0b1aebcc1adba1eb1dfc6c06d06534ca945..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/_form.html.haml
+++ /dev/null
@@ -1,46 +0,0 @@
-= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form gfm-form' } do |f|
- -if @page.errors.any?
- #error_explanation
- .alert.alert-danger
- - @page.errors.full_messages.each do |msg|
- %p= msg
-
- = f.hidden_field :title, value: @page.title
- .form-group
- = f.label :format, class: 'control-label'
- .col-sm-10
- = f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control"
-
- .row
- .col-sm-2
- .col-sm-10
- %p.cgray
- To link to a (new) page you can just type
- %code [Link Title](page-slug)
- \.
-
- .form-group.wiki-content
- = f.label :content, class: 'control-label'
- .col-sm-10
- = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
- = render 'projects/zen', f: f, attr: :content, classes: 'description form-control'
- .col-sm-12.hint
- .pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}
- .pull-right Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
-
- .clearfix
- .error-alert
- .form-group
- = f.label :commit_message, class: 'control-label'
- .col-sm-10= f.text_field :message, class: 'form-control', rows: 18
-
- .form-actions
- - if @page && @page.persisted?
- = f.submit 'Save changes', class: "btn-save btn"
- = link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, @page), class: "btn btn-cancel"
- - else
- = f.submit 'Create page', class: "btn-create btn"
- = link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, :home), class: "btn btn-cancel"
-
-:javascript
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
diff --git a/app/views/projects/wikis/_main_links.html.haml b/app/views/projects/wikis/_main_links.html.haml
deleted file mode 100644
index 633214a4e869f9d091a47b2968298b5bfa046c4c..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/_main_links.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%span.pull-right
- - if (@page && @page.persisted?)
- = link_to history_namespace_project_wiki_path(@project.namespace, @project, @page), class: "btn btn-grouped" do
- Page History
- - if can?(current_user, :write_wiki, @project)
- = link_to edit_namespace_project_wiki_path(@project.namespace, @project, @page), class: "btn btn-grouped" do
- %i.fa.fa-pencil-square-o
- Edit
diff --git a/app/views/projects/wikis/_nav.html.haml b/app/views/projects/wikis/_nav.html.haml
deleted file mode 100644
index 693c3facb3286c1f8e9805d2e37fcfe578ee6448..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/_nav.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-%ul.nav.nav-tabs
- = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do
- = link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home)
-
- = nav_link(path: 'wikis#pages') do
- = link_to 'Pages', pages_namespace_project_wikis_path(@project.namespace, @project)
-
- = nav_link(path: 'wikis#git_access') do
- = link_to git_access_namespace_project_wikis_path(@project.namespace, @project) do
- %i.fa.fa-download
- Git Access
-
- - if can?(current_user, :write_wiki, @project)
- .pull-right
- = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
- %i.fa.fa-plus
- New Page
-
-= render 'projects/wikis/new'
diff --git a/app/views/projects/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml
deleted file mode 100644
index 6834969de8b44e3a77b57b5f05fc6758d44e23d3..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/_new.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-%div#modal-new-wiki.modal.hide
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3.page-title New Wiki Page
- .modal-body
- = label_tag :new_wiki_path do
- %span Page slug
- = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'form-control', required: true, :'data-wikis-path' => namespace_project_wikis_path(@project.namespace, @project)
- %p.hint
- Please don't use spaces.
- .modal-footer
- = link_to 'Build', '#', class: 'build-new-wiki btn btn-create'
diff --git a/app/views/projects/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml
deleted file mode 100644
index 566850cb78d3487b10593cc71ae2aa8e41c3d203..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/edit.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-= render 'nav'
-.pull-right
- = render 'main_links'
-%h3.page-title
- Editing -
- %span.light #{@page.title}
-%hr
-= render 'form'
-
-.pull-right
- - if @page.persisted? && can?(current_user, :admin_wiki, @project)
- = link_to namespace_project_wiki_path(@project.namespace, @project, @page), data: { confirm: "Are you sure you want to delete this page?"}, method: :delete, class: "btn btn-sm btn-remove" do
- Delete this page
diff --git a/app/views/projects/wikis/empty.html.haml b/app/views/projects/wikis/empty.html.haml
deleted file mode 100644
index 48058124f97fc28154ae2f46ea4b6fdb4a258c8e..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/empty.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title Empty page
-%hr
-.error_message
- You are not allowed to create wiki pages
diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml
deleted file mode 100644
index 365edb524f43b97124a5f948001958f09a306809..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/git_access.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-= render 'nav'
-.row
- .col-sm-6
- %h3.page-title
- Git access for
- %strong= @project_wiki.path_with_namespace
-
- .col-sm-6
- = render "shared/clone_panel", project: @project_wiki
-
-.git-empty
- %fieldset
- %legend Install Gollum:
- %pre.dark
- :preserve
- gem install gollum
-
- %legend Clone Your Wiki:
- %pre.dark
- :preserve
- git clone #{ content_tag(:span, default_url_to_repo(@project_wiki), class: 'clone')}
- cd #{@project_wiki.path}
-
- %legend Start Gollum And Edit Locally:
- %pre.dark
- :preserve
- gollum
- == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin
- >> Thin web server (v1.5.0 codename Knife)
- >> Maximum connections set to 1024
- >> Listening on 0.0.0.0:4567, CTRL+C to stop
diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml
deleted file mode 100644
index 91291f753f772e66b579fa0c97cecfcfb8a69aab..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/history.html.haml
+++ /dev/null
@@ -1,30 +0,0 @@
-= render 'nav'
-%h3.page-title
- %span.light History for
- = link_to @page.title, namespace_project_wiki_path(@project.namespace, @project, @page)
-
-%table.table
- %thead
- %tr
- %th Page version
- %th Author
- %th Commit Message
- %th Last updated
- %th Format
- %tbody
- - @page.versions.each_with_index do |version, index|
- - commit = version
- %tr
- %td
- = link_to project_wiki_path_with_version(@project, @page,
- commit.id, index == 0) do
- = truncate_sha(commit.id)
- %td
- = commit.author.name
- %td
- = commit.message
- %td
- #{time_ago_with_tooltip(version.authored_date)}
- %td
- %strong
- = @page.page.wiki.page(@page.page.name, commit.id).try(:format)
diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml
deleted file mode 100644
index ee233d9086f99d02406169cf9881d7dec7cd40ba..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/pages.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-= render 'nav'
-%h3.page-title
- All Pages
-%ul.bordered-list
- - @wiki_pages.each do |wiki_page|
- %li
- %h4
- = link_to wiki_page.title, namespace_project_wiki_path(@project.namespace, @project, wiki_page)
- %small (#{wiki_page.format})
- .pull-right
- %small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)}
-= paginate @wiki_pages, theme: 'gitlab'
diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml
deleted file mode 100644
index a6263e93f678e515a11429df7755a25772b0af66..0000000000000000000000000000000000000000
--- a/app/views/projects/wikis/show.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-= render 'nav'
-%h3.page-title
- = @page.title
- = render 'main_links'
-- if @page.historical?
- .warning_message
- This is an old version of this page.
- You can view the #{link_to "most recent version", namespace_project_wiki_path(@project.namespace, @project, @page)} or browse the #{link_to "history", history_namespace_project_wiki_path(@project.namespace, @project, @page)}.
-
-%hr
-
-.wiki-holder
- .wiki
- = preserve do
- = render_wiki_content(@page)
-
-%hr
-
-.wiki-last-edit-by
- Last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)}
diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml
deleted file mode 100644
index ffc145497abe08dbd90335d997b3cc7272d7a0d8..0000000000000000000000000000000000000000
--- a/app/views/search/_filter.html.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-.dropdown.inline
- %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
- %span.light Group:
- - if @group.present?
- %strong= @group.name
- - else
- Any
- %b.caret
- %ul.dropdown-menu
- %li
- = link_to search_filter_path(group_id: nil) do
- Any
- - current_user.authorized_groups.sort_by(&:name).each do |group|
- %li
- = link_to search_filter_path(group_id: group.id, project_id: nil) do
- = group.name
-
-.dropdown.inline.prepend-left-10.project-filter
- %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
- %span.light Project:
- - if @project.present?
- %strong= @project.name_with_namespace
- - else
- Any
- %b.caret
- %ul.dropdown-menu
- %li
- = link_to search_filter_path(project_id: nil) do
- Any
- - current_user.authorized_projects.sort_by(&:name_with_namespace).each do |project|
- %li
- = link_to search_filter_path(project_id: project.id, group_id: nil) do
- = project.name_with_namespace
diff --git a/app/views/search/_global_filter.html.haml b/app/views/search/_global_filter.html.haml
deleted file mode 100644
index 442bd84f9308dbd83d864a2715a197d4f0102eaf..0000000000000000000000000000000000000000
--- a/app/views/search/_global_filter.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-%ul.nav.nav-pills.nav-stacked.search-filter
- %li{class: ("active" if @scope == 'projects')}
- = link_to search_filter_path(scope: 'projects') do
- Projects
- .pull-right
- = @search_results.projects_count
- %li{class: ("active" if @scope == 'issues')}
- = link_to search_filter_path(scope: 'issues') do
- Issues
- .pull-right
- = @search_results.issues_count
- %li{class: ("active" if @scope == 'merge_requests')}
- = link_to search_filter_path(scope: 'merge_requests') do
- Merge requests
- .pull-right
- = @search_results.merge_requests_count
diff --git a/app/views/search/_project_filter.html.haml b/app/views/search/_project_filter.html.haml
deleted file mode 100644
index ad933502a282d928dd92c93c9f604b1f480936bd..0000000000000000000000000000000000000000
--- a/app/views/search/_project_filter.html.haml
+++ /dev/null
@@ -1,32 +0,0 @@
-%ul.nav.nav-pills.nav-stacked.search-filter
- %li{class: ("active" if @scope == 'blobs')}
- = link_to search_filter_path(scope: 'blobs') do
- %i.fa.fa-code
- Code
- .pull-right
- = @search_results.blobs_count
- %li{class: ("active" if @scope == 'issues')}
- = link_to search_filter_path(scope: 'issues') do
- %i.fa.fa-exclamation-circle
- Issues
- .pull-right
- = @search_results.issues_count
- %li{class: ("active" if @scope == 'merge_requests')}
- = link_to search_filter_path(scope: 'merge_requests') do
- %i.fa.fa-code-fork
- Merge requests
- .pull-right
- = @search_results.merge_requests_count
- %li{class: ("active" if @scope == 'notes')}
- = link_to search_filter_path(scope: 'notes') do
- %i.fa.fa-comments
- Comments
- .pull-right
- = @search_results.notes_count
- %li{class: ("active" if @scope == 'wiki_blobs')}
- = link_to search_filter_path(scope: 'wiki_blobs') do
- %i.fa.fa-book
- Wiki
- .pull-right
- = @search_results.wiki_blobs_count
-
diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml
deleted file mode 100644
index 796dd752a4c8db68a17e067080dd7a97c3c2a79a..0000000000000000000000000000000000000000
--- a/app/views/search/_results.html.haml
+++ /dev/null
@@ -1,28 +0,0 @@
-%h4
- #{@search_results.total_count} results found
- - unless @show_snippets
- - if @project
- for #{link_to @project.name_with_namespace, [@project.namespace.becomes(Namespace), @project]}
- - elsif @group
- for #{link_to @group.name, @group}
-
-%hr
-
-.row
- .col-sm-3
- - if @project
- = render "project_filter"
- - elsif @show_snippets
- = render 'snippet_filter'
- - else
- = render "global_filter"
- .col-sm-9
- .search-results
- - if @search_results.empty?
- = render partial: "search/results/empty", locals: { message: "We couldn't find any matching results" }
- - else
- = render partial: "search/results/#{@scope.singularize}", collection: @objects
- = paginate @objects, theme: 'gitlab'
-
-:javascript
- $(".search-results .term").highlight("#{escape_javascript(params[:search])}");
diff --git a/app/views/search/_snippet_filter.html.haml b/app/views/search/_snippet_filter.html.haml
deleted file mode 100644
index 95d23fa9f47c9020bfbe38680c00d18b3cf48c18..0000000000000000000000000000000000000000
--- a/app/views/search/_snippet_filter.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%ul.nav.nav-pills.nav-stacked.search-filter
- %li{class: ("active" if @scope == 'snippet_blobs')}
- = link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
- %i.fa.fa-code
- Snippet Contents
- .pull-right
- = @search_results.snippet_blobs_count
- %li{class: ("active" if @scope == 'snippet_titles')}
- = link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
- %i.fa.fa-book
- Titles and Filenames
- .pull-right
- = @search_results.snippet_titles_count
diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml
deleted file mode 100644
index 84e9be82c444e2596cc2c95472ed282a9e5dd18f..0000000000000000000000000000000000000000
--- a/app/views/search/results/_blob.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.blob-result
- .file-holder
- .file-title
- = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(blob.ref, blob.filename), :anchor => "L" + blob.startline.to_s) do
- %i.fa.fa-file
- %strong
- = blob.filename
- .file-content.code.term
- = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, user_color_scheme_class: 'white'
diff --git a/app/views/search/results/_empty.html.haml b/app/views/search/results/_empty.html.haml
deleted file mode 100644
index 01fb8cd9b8ec9daaa675c2040626b416f90a520e..0000000000000000000000000000000000000000
--- a/app/views/search/results/_empty.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-.search_box
- .search_glyph
- %span.fa.fa-search
- %h4 #{message}
diff --git a/app/views/search/results/_issue.html.haml b/app/views/search/results/_issue.html.haml
deleted file mode 100644
index ce8ddff955690ea4895580cdb23945e75fd8bd7d..0000000000000000000000000000000000000000
--- a/app/views/search/results/_issue.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-.search-result-row
- %h4
- = link_to [issue.project.namespace.becomes(Namespace), issue.project, issue] do
- %span.term.str-truncated= issue.title
- .pull-right ##{issue.iid}
- - if issue.description.present?
- .description.term
- = preserve do
- = search_md_sanitize(markdown(issue.description))
- %span.light
- #{issue.project.name_with_namespace}
- - if issue.closed?
- .pull-right
- %span.label.label-danger Closed
diff --git a/app/views/search/results/_merge_request.html.haml b/app/views/search/results/_merge_request.html.haml
deleted file mode 100644
index 2efa616d6644e453a53415d6fcf8fbdac5eb4c33..0000000000000000000000000000000000000000
--- a/app/views/search/results/_merge_request.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-.search-result-row
- %h4
- = link_to [merge_request.target_project.namespace.becomes(Namespace), merge_request.target_project, merge_request] do
- %span.term.str-truncated= merge_request.title
- .pull-right ##{merge_request.iid}
- - if merge_request.description.present?
- .description.term
- = preserve do
- = search_md_sanitize(markdown(merge_request.description))
- %span.light
- #{merge_request.project.name_with_namespace}
- .pull-right
- - if merge_request.merged?
- %span.label.label-primary Merged
- - elsif merge_request.closed?
- %span.label.label-danger Closed
diff --git a/app/views/search/results/_note.html.haml b/app/views/search/results/_note.html.haml
deleted file mode 100644
index 5fcba2b7e93b22938d73635dad5295ceb476329b..0000000000000000000000000000000000000000
--- a/app/views/search/results/_note.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-- project = note.project
-.search-result-row
- %h5.note-search-caption.str-truncated
- %i.fa.fa-comment
- = link_to_member(project, note.author, avatar: false)
- commented on
-
- - if note.for_commit?
- = link_to project do
- = project.name_with_namespace
- ·
- = link_to namespace_project_commit_path(project.namespace, project, note.commit_id, anchor: dom_id(note)) do
- Commit #{truncate_sha(note.commit_id)}
- - else
- = link_to project do
- = project.name_with_namespace
- ·
- %span #{note.noteable_type.titleize} ##{note.noteable.iid}
- ·
- = link_to [project.namespace.becomes(Namespace), project, note.noteable, anchor: dom_id(note)] do
- = note.noteable.title
-
- .note-search-result
- .term
- = preserve do
- = search_md_sanitize(markdown(note.note, {no_header_anchors: true}))
diff --git a/app/views/search/results/_project.html.haml b/app/views/search/results/_project.html.haml
deleted file mode 100644
index 195cf06c8ea73fa1b208d7f7556ddef491985ae8..0000000000000000000000000000000000000000
--- a/app/views/search/results/_project.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.search-result-row
- %h4
- = link_to [project.namespace.becomes(Namespace), project] do
- %span.term= project.name_with_namespace
- - if project.description.present?
- %span.light.term= project.description
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
deleted file mode 100644
index 8af393777f0c32d4dde8597c762967769d1ae366..0000000000000000000000000000000000000000
--- a/app/views/search/results/_snippet_blob.html.haml
+++ /dev/null
@@ -1,59 +0,0 @@
-.search-result-row
- %span
- = snippet_blob[:snippet_object].title
- by
- = link_to user_snippets_path(snippet_blob[:snippet_object].author) do
- = image_tag avatar_icon(snippet_blob[:snippet_object].author_email), class: "avatar avatar-inline s16", alt: ''
- = snippet_blob[:snippet_object].author_name
- %span.light #{time_ago_with_tooltip(snippet_blob[:snippet_object].created_at)}
- %h4.snippet-title
- - snippet_path = reliable_snippet_path(snippet_blob[:snippet_object])
- = link_to snippet_path do
- .file-holder
- .file-title
- %i.fa.fa-file
- %strong= snippet_blob[:snippet_object].file_name
- - if gitlab_markdown?(snippet_blob[:snippet_object].file_name)
- .file-content.wiki
- - snippet_blob[:snippet_chunks].each do |snippet|
- - unless snippet[:data].empty?
- = preserve do
- = markdown(snippet[:data])
- - else
- .file-content.code
- .nothing-here-block Empty file
- - elsif markup?(snippet_blob[:snippet_object].file_name)
- .file-content.wiki
- - snippet_blob[:snippet_chunks].each do |snippet|
- - unless snippet[:data].empty?
- = render_markup(snippet_blob[:snippet_object].file_name, snippet[:data])
- - else
- .file-content.code
- .nothing-here-block Empty file
- - else
- .file-content.code
- %div.highlighted-data{class: user_color_scheme_class}
- .line-numbers
- - snippet_blob[:snippet_chunks].each do |snippet|
- - unless snippet[:data].empty?
- - snippet[:data].lines.to_a.size.times do |index|
- - offset = defined?(snippet[:start_line]) ? snippet[:start_line] : 1
- - i = index + offset
- = link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}" do
- %i.fa.fa-link
- = i
- - unless snippet == snippet_blob[:snippet_chunks].last
- %a
- = "."
- .highlight.term
- %pre
- %code
- - snippet_blob[:snippet_chunks].each do |snippet|
- - unless snippet[:data].empty?
- = snippet[:data]
- - unless snippet == snippet_blob[:snippet_chunks].last
- %a
- = "..."
- - else
- .file-content.code
- .nothing-here-block Empty file
diff --git a/app/views/search/results/_snippet_title.html.haml b/app/views/search/results/_snippet_title.html.haml
deleted file mode 100644
index c414acb6a11118080b000133a372f6df57984bc9..0000000000000000000000000000000000000000
--- a/app/views/search/results/_snippet_title.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-.search-result-row
- %h4.snippet-title.term
- = link_to reliable_snippet_path(snippet_title) do
- = truncate(snippet_title.title, length: 60)
- - if snippet_title.private?
- %span.label.label-gray
- %i.fa.fa-lock
- private
- %span.cgray.monospace.tiny.pull-right.term
- = snippet_title.file_name
-
- %small.pull-right.cgray
- - if snippet_title.project_id?
- = link_to snippet_title.project.name_with_namespace, namespace_project_path(snippet_title.project.namespace, snippet_title.project)
-
- .snippet-info
- = "##{snippet_title.id}"
- %span
- by
- = link_to user_snippets_path(snippet_title.author) do
- = image_tag avatar_icon(snippet_title.author_email), class: "avatar avatar-inline s16", alt: ''
- = snippet_title.author_name
- %span.light #{time_ago_with_tooltip(snippet_title.created_at)}
diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml
deleted file mode 100644
index f9c5810e3d057962ec92eb8f913e3b7b2c93b4ed..0000000000000000000000000000000000000000
--- a/app/views/search/results/_wiki_blob.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.blob-result
- .file-holder
- .file-title
- = link_to namespace_project_wiki_path(@project.namespace, @project, wiki_blob.filename) do
- %i.fa.fa-file
- %strong
- = wiki_blob.filename
- .file-content.code.term
- = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline, user_color_scheme_class: 'white'
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
deleted file mode 100644
index 5b4816e4c40d38129309d3b7abca456065d2b95e..0000000000000000000000000000000000000000
--- a/app/views/search/show.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-= form_tag search_path, method: :get, class: 'form-horizontal' do |f|
- .search-holder.clearfix
- .form-group
- = label_tag :search, class: 'control-label' do
- %span Looking for
- .col-sm-6
- = search_field_tag :search, params[:search], placeholder: "issue 143", class: "form-control search-text-input", id: "dashboard_search"
- .col-sm-4
- = button_tag 'Search', class: "btn btn-create"
- .form-group
- .col-sm-2
- - unless params[:snippets].eql? 'true'
- .col-sm-10
- = render 'filter', f: f
- = hidden_field_tag :project_id, params[:project_id]
- = hidden_field_tag :group_id, params[:group_id]
- = hidden_field_tag :snippets, params[:snippets]
- = hidden_field_tag :scope, params[:scope]
-
- .results.prepend-top-10
- - if params[:search].present?
- = render 'search/results'
diff --git a/app/views/shared/_choose_group_avatar_button.html.haml b/app/views/shared/_choose_group_avatar_button.html.haml
deleted file mode 100644
index 000532b1c9a8f8ae71a271345c35eb28bd36f34b..0000000000000000000000000000000000000000
--- a/app/views/shared/_choose_group_avatar_button.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%a.choose-btn.btn.btn-sm.js-choose-group-avatar-button
- %i.fa.fa-paperclip
- %span Choose File ...
-
-%span.file_name.js-avatar-filename File name...
-= f.file_field :avatar, class: 'js-group-avatar-input hidden'
-.light The maximum file size allowed is 200KB.
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml
deleted file mode 100644
index a1121750ca349e0b25ba94fdf77a228385660789..0000000000000000000000000000000000000000
--- a/app/views/shared/_clone_panel.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-- project = project || @project
-.git-clone-holder.input-group
- .input-group-btn
- %button{ |
- class: "btn #{ 'active' if default_clone_protocol == 'ssh' }#{ ' has_tooltip' if current_user && current_user.require_ssh_key? }", |
- :"data-clone" => project.ssh_url_to_repo, |
- :"data-title" => "Add an SSH key to your profile
to pull or push via SSH",
- :"data-html" => "true",
- :"data-container" => "body"}
- SSH
- %button{ |
- class: "btn #{ 'active' if default_clone_protocol == 'http' }#{ ' has_tooltip' if current_user && current_user.require_password? }", |
- :"data-clone" => project.http_url_to_repo, |
- :"data-title" => "Set a password on your account
to pull or push via #{gitlab_config.protocol.upcase}",
- :"data-html" => "true",
- :"data-container" => "body"}
- = gitlab_config.protocol.upcase
- = text_field_tag :project_clone, default_url_to_repo(project), class: "one_click_select form-control", readonly: true
- - if project.kind_of?(Project)
- .input-group-addon
- .visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" }
- = visibility_level_icon(project.visibility_level)
- = visibility_level_label(project.visibility_level).downcase
diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml
deleted file mode 100644
index 5071ff640f18c08bbe3d0bf0e565defe32221b38..0000000000000000000000000000000000000000
--- a/app/views/shared/_commit_message_container.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-.form-group.commit_message-group
- = label_tag 'commit_message', class: 'control-label' do
- Commit message
- .col-sm-10
- .commit-message-container
- .max-width-marker
- = text_area_tag 'commit_message',
- (params[:commit_message] || local_assigns[:text]),
- class: 'form-control', placeholder: local_assigns[:placeholder],
- required: true, rows: (local_assigns[:rows] || 3)
- - if local_assigns[:hint]
- %p.hint
- Try to keep the first line under 52 characters
- and the others under 72.
diff --git a/app/views/shared/_confirm_modal.html.haml b/app/views/shared/_confirm_modal.html.haml
deleted file mode 100644
index 30ba361c860530ffaffdb5df9e274b8c71aafc03..0000000000000000000000000000000000000000
--- a/app/views/shared/_confirm_modal.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-#modal-confirm-danger.modal.hide{tabindex: -1}
- .modal-dialog
- .modal-content
- .modal-header
- %a.close{href: "#", "data-dismiss" => "modal"} ×
- %h4 Confirmation required
-
- .modal-body
- %p.cred.lead.js-confirm-text
-
- %p
- This action can lead to data loss.
- To prevent accidental actions we ask you to confirm your intention.
- %br
- Please type
- %code.js-confirm-danger-match #{phrase}
- to proceed or close this modal to cancel
-
- .form-group
- = text_field_tag 'confirm_name_input', '', class: 'form-control js-confirm-danger-input'
- .form-group
- = submit_tag 'Confirm', class: "btn btn-danger js-confirm-danger-submit"
diff --git a/app/views/shared/_event_filter.html.haml b/app/views/shared/_event_filter.html.haml
deleted file mode 100644
index d07a9e2b92468860f9b77d3345b27dc6fff5e97c..0000000000000000000000000000000000000000
--- a/app/views/shared/_event_filter.html.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-%ul.nav.nav-pills.event_filter
- = event_filter_link EventFilter.push, 'Push events'
- = event_filter_link EventFilter.merged, 'Merge events'
- = event_filter_link EventFilter.comments, 'Comments'
- = event_filter_link EventFilter.team, 'Team'
-
- - if current_user
- - if current_controller?(:dashboard)
- %li.pull-right
- = link_to dashboard_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do
- %i.fa.fa-rss
- News Feed
-
- - if current_controller?(:groups)
- %li.pull-right
- = link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'rss-btn' do
- %i.fa.fa-rss
- News Feed
-%hr
diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml
deleted file mode 100644
index fba69dd0f3fb2974adb6d3ad2e9e2b9002f785b2..0000000000000000000000000000000000000000
--- a/app/views/shared/_file_highlight.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-.file-content.code{class: user_color_scheme_class}
- .line-numbers
- - if blob.data.present?
- - blob.data.lines.to_a.size.times do |index|
- - offset = defined?(first_line_number) ? first_line_number : 1
- - i = index + offset
- = link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
- %i.fa.fa-link
- = i
- :preserve
- #{highlight(blob.name, blob.data)}
diff --git a/app/views/shared/_group_form.html.haml b/app/views/shared/_group_form.html.haml
deleted file mode 100644
index c0a9923348e72b49d8d1bd6d18f177fd06d2ea5b..0000000000000000000000000000000000000000
--- a/app/views/shared/_group_form.html.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-- if @group.persisted?
- .form-group
- = f.label :name, class: 'control-label' do
- Group name
- .col-sm-10
- = f.text_field :name, placeholder: 'open-source', class: 'form-control'
-
-.form-group
- = f.label :path, class: 'control-label' do
- Group path
- .col-sm-10
- .input-group
- .input-group-addon
- = root_url
- = f.text_field :path, placeholder: 'open-source', class: 'form-control',
- autofocus: local_assigns[:autofocus] || false
- - if @group.persisted?
- .alert.alert-warning.prepend-top-10
- %ul
- %li Changing group path can have unintended side effects.
- %li Renaming group path will rename directory for all related projects
- %li It will change web url for access group and group projects.
- %li It will change the git path to repositories under this group.
-
-.form-group.group-description-holder
- = f.label :description, 'Details', class: 'control-label'
- .col-sm-10
- = f.text_area :description, maxlength: 250,
- class: 'form-control js-gfm-input', rows: 4
diff --git a/app/views/shared/_group_tips.html.haml b/app/views/shared/_group_tips.html.haml
deleted file mode 100644
index e5cf783beb7ae21505440dfc6296c159bd382a74..0000000000000000000000000000000000000000
--- a/app/views/shared/_group_tips.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%ul
- %li A group is a collection of several projects
- %li Groups are private by default
- %li Members of a group may only view projects they have permission to access
- %li Group project URLs are prefixed with the group namespace
- %li Existing projects may be moved into a group
diff --git a/app/views/shared/_issuable_filter.html.haml b/app/views/shared/_issuable_filter.html.haml
deleted file mode 100644
index 83f5a3a8015ef276467f55072924b803f2b888e6..0000000000000000000000000000000000000000
--- a/app/views/shared/_issuable_filter.html.haml
+++ /dev/null
@@ -1,58 +0,0 @@
-.issues-filters
- .issues-state-filters
- %ul.nav.nav-tabs
- %li{class: ("active" if params[:state] == 'opened')}
- = link_to page_filter_path(state: 'opened') do
- %i.fa.fa-exclamation-circle
- Open
- %li{class: ("active" if params[:state] == 'closed')}
- = link_to page_filter_path(state: 'closed') do
- %i.fa.fa-check-circle
- Closed
- %li{class: ("active" if params[:state] == 'all')}
- = link_to page_filter_path(state: 'all') do
- %i.fa.fa-compass
- All
-
- .issues-details-filters
- = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_id, :label_name]), method: :get, class: 'filter-form' do
- - if controller.controller_name == 'issues'
- .check-all-holder
- = check_box_tag "check_all_issues", nil, false,
- class: "check_all_issues left",
- disabled: !can?(current_user, :modify_issue, @project)
- .issues-other-filters
- .filter-item.inline
- = users_select_tag(:assignee_id, selected: params[:assignee_id],
- placeholder: 'Assignee', class: 'trigger-submit', any_user: true, null_user: true, first_user: true)
-
- .filter-item.inline
- = users_select_tag(:author_id, selected: params[:author_id],
- placeholder: 'Author', class: 'trigger-submit', any_user: true, first_user: true)
-
- .filter-item.inline.milestone-filter
- = select_tag('milestone_id', projects_milestones_options, class: "select2 trigger-submit", prompt: 'Milestone')
-
- - if @project
- .filter-item.inline.labels-filter
- = select_tag('label_name', project_labels_options(@project), class: "select2 trigger-submit", prompt: 'Label')
-
- .pull-right
- = render 'shared/sort_dropdown'
-
- - if controller.controller_name == 'issues'
- .issues_bulk_update.hide
- = form_tag bulk_update_namespace_project_issues_path(@project.namespace, @project), method: :post do
- = select_tag('update[state_event]', options_for_select([['Open', 'reopen'], ['Closed', 'close']]), prompt: "Status", class: 'form-control')
- = users_select_tag('update[assignee_id]', placeholder: 'Assignee', null_user: true)
- = select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone")
- = hidden_field_tag 'update[issues_ids]', []
- = hidden_field_tag :state_event, params[:state_event]
- = button_tag "Update issues", class: "btn update_selected_issues btn-save"
-
-:coffeescript
- new UsersSelect()
-
- $('form.filter-form').on 'submit', (event) ->
- event.preventDefault()
- Turbolinks.visit @.action + '&' + $(@).serialize()
diff --git a/app/views/shared/_issuable_search_form.html.haml b/app/views/shared/_issuable_search_form.html.haml
deleted file mode 100644
index 639d203dcd69007e543e4d433301685a1796dd0c..0000000000000000000000000000000000000000
--- a/app/views/shared/_issuable_search_form.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-= form_tag(path, method: :get, id: "issue_search_form", class: 'pull-left issue-search-form') do
- .append-right-10.hidden-xs.hidden-sm
- = search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input input-mn-300' }
- = hidden_field_tag :state, params['state']
- = hidden_field_tag :scope, params['scope']
- = hidden_field_tag :assignee_id, params['assignee_id']
- = hidden_field_tag :author_id, params['author_id']
- = hidden_field_tag :milestone_id, params['milestone_id']
- = hidden_field_tag :label_id, params['label_id']
diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml
deleted file mode 100644
index 0dbb6a04393720ada519a3b81d158f1a6e7f6b27..0000000000000000000000000000000000000000
--- a/app/views/shared/_issues.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-- if @issues.any?
- - @issues.group_by(&:project).each do |group|
- .panel.panel-default.panel-small
- - project = group[0]
- .panel-heading
- = link_to_project project
- = link_to 'show all', namespace_project_issues_path(project.namespace, project), class: 'pull-right'
-
- %ul.well-list.issues-list
- - group[1].each do |issue|
- = render 'projects/issues/issue', issue: issue
- = paginate @issues, theme: "gitlab"
-- else
- .nothing-here-block No issues to show
-
diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml
deleted file mode 100644
index c02c5af008a35deffb3599f5c40ac886827e6744..0000000000000000000000000000000000000000
--- a/app/views/shared/_merge_requests.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-- if @merge_requests.any?
- - @merge_requests.group_by(&:target_project).each do |group|
- .panel.panel-default.panel-small
- - project = group[0]
- .panel-heading
- = link_to_project project
- = link_to 'show all', namespace_project_merge_requests_path(project.namespace, project), class: 'pull-right'
- %ul.well-list.mr-list
- - group[1].each do |merge_request|
- = render 'projects/merge_requests/merge_request', merge_request: merge_request
- = paginate @merge_requests, theme: "gitlab"
-
-- else
- .nothing-here-block No merge requests to show
diff --git a/app/views/shared/_milestones_filter.html.haml b/app/views/shared/_milestones_filter.html.haml
deleted file mode 100644
index f685ae7726c62090cb6d495e18b24ba44edee478..0000000000000000000000000000000000000000
--- a/app/views/shared/_milestones_filter.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-.milestones-filters.append-bottom-10
- %ul.nav.nav-tabs
- %li{class: ("active" if params[:state].blank? || params[:state] == 'opened')}
- = link_to milestones_filter_path(state: 'opened') do
- %i.fa.fa-exclamation-circle
- Open
- %li{class: ("active" if params[:state] == 'closed')}
- = link_to milestones_filter_path(state: 'closed') do
- %i.fa.fa-check-circle
- Closed
- %li{class: ("active" if params[:state] == 'all')}
- = link_to milestones_filter_path(state: 'all') do
- %i.fa.fa-compass
- All
diff --git a/app/views/shared/_no_password.html.haml b/app/views/shared/_no_password.html.haml
deleted file mode 100644
index a43bf33751a9365520535d0e569e4842528541d6..0000000000000000000000000000000000000000
--- a/app/views/shared/_no_password.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-- if cookies[:hide_no_password_message].blank? && !current_user.hide_no_password && current_user.require_password?
- .no-password-message.alert.alert-warning.hidden-xs
- You won't be able to pull or push project code via #{gitlab_config.protocol.upcase} until you #{link_to 'set a password', edit_profile_password_path} on your account
-
- .pull-right
- = link_to "Don't show again", profile_path(user: {hide_no_password: true}), method: :put
- |
- = link_to 'Remind later', '#', class: 'hide-no-password-message'
diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml
deleted file mode 100644
index 089179e677aee39c0b6d91b7859d8e4a9afb149b..0000000000000000000000000000000000000000
--- a/app/views/shared/_no_ssh.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-- if cookies[:hide_no_ssh_message].blank? && !current_user.hide_no_ssh_key && current_user.require_ssh_key?
- .no-ssh-key-message.alert.alert-warning.hidden-xs
- You won't be able to pull or push project code via SSH until you #{link_to 'add an SSH key', new_profile_key_path, class: 'alert-link'} to your profile
-
- .pull-right
- = link_to "Don't show again", profile_path(user: {hide_no_ssh_key: true}), method: :put, class: 'alert-link'
- |
- = link_to 'Remind later', '#', class: 'hide-no-ssh-message alert-link'
diff --git a/app/views/shared/_outdated_browser.html.haml b/app/views/shared/_outdated_browser.html.haml
deleted file mode 100644
index 0eba1fe075f35762dbe37f0bae29c77dbfe02db7..0000000000000000000000000000000000000000
--- a/app/views/shared/_outdated_browser.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-- if outdated_browser?
- - link = "https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/requirements.md#supported-web-browsers"
- .browser-alert
- GitLab may not work properly because you are using an outdated web browser.
- %br
- Please install a
- = link_to 'supported web browser', link
- for a better experience.
diff --git a/app/views/shared/_project.html.haml b/app/views/shared/_project.html.haml
deleted file mode 100644
index 722a7f7ce0f467da4a7f88cbfc7ffbbdf5c634f4..0000000000000000000000000000000000000000
--- a/app/views/shared/_project.html.haml
+++ /dev/null
@@ -1,21 +0,0 @@
-= cache [project.namespace, project, controller.controller_name, controller.action_name] do
- = link_to project_path(project), class: dom_class(project) do
- - if avatar
- .dash-project-avatar
- = project_icon(project, alt: '', class: 'avatar project-avatar s40')
- .dash-project-access-icon
- = visibility_level_icon(project.visibility_level)
- %span.str-truncated
- %span.namespace-name
- - if project.namespace
- = project.namespace.human_name
- \/
- %span.project-name.filter-title
- = project.name
- - if stars
- %span.pull-right.light
- %i.fa.fa-star
- = project.star_count
- - else
- %span.arrow
- %i.fa.fa-angle-right
diff --git a/app/views/shared/_projects_list.html.haml b/app/views/shared/_projects_list.html.haml
deleted file mode 100644
index 4c58092af44ca17c60a75dd231dc87e5556bd179..0000000000000000000000000000000000000000
--- a/app/views/shared/_projects_list.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-- projects_limit = 20 unless local_assigns[:projects_limit]
-- avatar = true unless local_assigns[:avatar] == false
-- stars = false unless local_assigns[:stars] == true
-%ul.well-list.projects-list
- - projects.each_with_index do |project, i|
- %li{class: (i >= projects_limit) ? 'project-row hide' : 'project-row'}
- = render "shared/project", project: project, avatar: avatar, stars: stars
- - if projects.blank?
- %li
- .nothing-here-block There are no projects here.
- - if projects.count > projects_limit
- %li.bottom
- %span.light
- #{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
- %span
- = link_to '#', class: 'js-expand' do
- Show all
diff --git a/app/views/shared/_promo.html.haml b/app/views/shared/_promo.html.haml
deleted file mode 100644
index 3596aabe309d14fc23ea7015fd834436e0d5443c..0000000000000000000000000000000000000000
--- a/app/views/shared/_promo.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-.gitlab-promo
- = link_to 'Homepage', promo_url
- = link_to "Blog", promo_url + '/blog/'
- = link_to "@gitlab", "https://twitter.com/gitlab"
- = link_to "Requests", "http://feedback.gitlab.com/"
diff --git a/app/views/shared/_ref_switcher.html.haml b/app/views/shared/_ref_switcher.html.haml
deleted file mode 100644
index eb2e1919e190541aae8b412ccab832b25dbfe79e..0000000000000000000000000000000000000000
--- a/app/views/shared/_ref_switcher.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-= form_tag switch_namespace_project_refs_path(@project.namespace, @project), method: :get, class: "project-refs-form" do
- = select_tag "ref", grouped_options_refs, class: "project-refs-select select2 select2-sm"
- = hidden_field_tag :destination, destination
- - if defined?(path)
- = hidden_field_tag :path, path
- - @options && @options.each do |key, value|
- = hidden_field_tag key, value, id: nil
diff --git a/app/views/shared/_sort_dropdown.html.haml b/app/views/shared/_sort_dropdown.html.haml
deleted file mode 100644
index af3d35de325d7465360f5764f600d5e2aa7b307c..0000000000000000000000000000000000000000
--- a/app/views/shared/_sort_dropdown.html.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-.dropdown.inline.prepend-left-10
- %button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %span.light sort:
- - if @sort.present?
- = sort_options_hash[@sort]
- - else
- = sort_title_recently_created
- %b.caret
- %ul.dropdown-menu.dropdown-menu-align-right
- %li
- = link_to page_filter_path(sort: sort_value_recently_created) do
- = sort_title_recently_created
- = link_to page_filter_path(sort: sort_value_oldest_created) do
- = sort_title_oldest_created
- = link_to page_filter_path(sort: sort_value_recently_updated) do
- = sort_title_recently_updated
- = link_to page_filter_path(sort: sort_value_oldest_updated) do
- = sort_title_oldest_updated
- = link_to page_filter_path(sort: sort_value_milestone_soon) do
- = sort_title_milestone_soon
- = link_to page_filter_path(sort: sort_value_milestone_later) do
- = sort_title_milestone_later
diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml
deleted file mode 100644
index 30458793fd13e04ec7538cb3ded4ef91cc92dde0..0000000000000000000000000000000000000000
--- a/app/views/shared/snippets/_blob.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-- unless @snippet.content.empty?
- - if gitlab_markdown?(@snippet.file_name)
- .file-content.wiki
- = preserve do
- = markdown(@snippet.data)
- - elsif markup?(@snippet.file_name)
- .file-content.wiki
- = render_markup(@snippet.file_name, @snippet.data)
- - else
- .file-content.code
- = render 'shared/file_highlight', blob: @snippet
-- else
- .file-content.code
- .nothing-here-block Empty file
diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml
deleted file mode 100644
index 4e0663ea2080b087a3226124394d2fddf324925a..0000000000000000000000000000000000000000
--- a/app/views/shared/snippets/_form.html.haml
+++ /dev/null
@@ -1,41 +0,0 @@
-.snippet-form-holder
- = form_for @snippet, url: url, html: { class: "form-horizontal snippet-form" } do |f|
- - if @snippet.errors.any?
- .alert.alert-danger
- %ul
- - @snippet.errors.full_messages.each do |msg|
- %li= msg
-
- .form-group
- = f.label :title, class: 'control-label'
- .col-sm-10= f.text_field :title, placeholder: "Example Snippet", class: 'form-control', required: true
-
- = render "shared/snippets/visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
-
- .form-group
- .file-editor
- = f.label :file_name, "File", class: 'control-label'
- .col-sm-10
- .file-holder.snippet
- .file-title
- = f.text_field :file_name, placeholder: "example.rb", class: 'form-control snippet-file-name', required: true
- .file-content.code
- %pre#editor= @snippet.content
- = f.hidden_field :content, class: 'snippet-file-content'
-
- .form-actions
- - if @snippet.new_record?
- = f.submit 'Create snippet', class: "btn-create btn"
- - else
- = f.submit 'Save', class: "btn-save btn"
-
- - if @snippet.respond_to?(:project)
- = link_to "Cancel", namespace_project_snippets_path(@project.namespace, @project), class: "btn btn-cancel"
- - else
- = link_to "Cancel", snippets_path(@project), class: "btn btn-cancel"
-
-:javascript
- var editor = ace.edit("editor");
- $(".snippet-form-holder form").submit(function(){
- $(".snippet-file-content").val(editor.getValue());
- });
diff --git a/app/views/shared/snippets/_visibility_level.html.haml b/app/views/shared/snippets/_visibility_level.html.haml
deleted file mode 100644
index 9acff18e450f2302e69440df80273a5b73c18ad6..0000000000000000000000000000000000000000
--- a/app/views/shared/snippets/_visibility_level.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-.form-group.project-visibility-level-holder
- = f.label :visibility_level, class: 'control-label' do
- Visibility Level
- = link_to "(?)", help_page_path("public_access", "public_access")
- .col-sm-10
- - if can_change_visibility_level
- - Gitlab::VisibilityLevel.values.each do |level|
- .radio
- - restricted = restricted_visibility_levels.include?(level)
- = f.radio_button :visibility_level, level, disabled: restricted
- = label "#{dom_class(@snippet)}_visibility_level", level do
- = visibility_level_icon(level)
- .option-title
- = visibility_level_label(level)
- .option-descr
- = snippet_visibility_level_description(level)
- - unless restricted_visibility_levels.empty?
- .col-sm-10
- %span.info
- Some visibility level settings have been restricted by the administrator.
- - else
- .col-sm-10
- %span.info
- = visibility_level_icon(visibility_level)
- %strong
- = visibility_level_label(visibility_level)
- .light= visibility_level_description(visibility_level)
diff --git a/app/views/snippets/_snippet.html.haml b/app/views/snippets/_snippet.html.haml
deleted file mode 100644
index 5bb28664349416608c23b1c75db98a4ee406f63e..0000000000000000000000000000000000000000
--- a/app/views/snippets/_snippet.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-%li
- %h4.snippet-title
- = link_to reliable_snippet_path(snippet) do
- = truncate(snippet.title, length: 60)
- - if snippet.private?
- %span.label.label-gray
- %i.fa.fa-lock
- private
- %span.cgray.monospace.tiny.pull-right
- = snippet.file_name
-
- %small.pull-right.cgray
- - if snippet.project_id?
- = link_to snippet.project.name_with_namespace, namespace_project_path(snippet.project.namespace, snippet.project)
-
- .snippet-info
- = "##{snippet.id}"
- %span
- by
- = link_to user_snippets_path(snippet.author) do
- = image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: ''
- = snippet.author_name
- %span.light #{time_ago_with_tooltip(snippet.created_at)}
diff --git a/app/views/snippets/_snippets.html.haml b/app/views/snippets/_snippets.html.haml
deleted file mode 100644
index 40df42b6cf5805d73d67165769621f8528105eec..0000000000000000000000000000000000000000
--- a/app/views/snippets/_snippets.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%ul.bordered-list
- = render partial: 'snippet', collection: @snippets
- - if @snippets.empty?
- %li
- .nothing-here-block Nothing here.
-
-= paginate @snippets, theme: 'gitlab'
diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml
deleted file mode 100644
index 0df5ade500db382bb0e31ec111f6ff37204cc6e5..0000000000000000000000000000000000000000
--- a/app/views/snippets/current_user_index.html.haml
+++ /dev/null
@@ -1,39 +0,0 @@
-%h3.page-title
- Your Snippets
- .pull-right
- = link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do
- Add new snippet
- = link_to snippets_path, class: "btn btn-grouped" do
- Discover snippets
-
-%p.light
- Share code pastes with others out of git repository
-%hr
-
-.row
- .col-md-3
- %ul.nav.nav-pills.nav-stacked
- = nav_tab :scope, nil do
- = link_to user_snippets_path(@user) do
- All
- %span.pull-right
- = @user.snippets.count
- = nav_tab :scope, 'are_private' do
- = link_to user_snippets_path(@user, scope: 'are_private') do
- Private
- %span.pull-right
- = @user.snippets.are_private.count
- = nav_tab :scope, 'are_internal' do
- = link_to user_snippets_path(@user, scope: 'are_internal') do
- Internal
- %span.pull-right
- = @user.snippets.are_internal.count
- = nav_tab :scope, 'are_public' do
- = link_to user_snippets_path(@user, scope: 'are_public') do
- Public
- %span.pull-right
- = @user.snippets.are_public.count
-
- .col-md-9.my-snippets
- = render 'snippets'
-
diff --git a/app/views/snippets/edit.html.haml b/app/views/snippets/edit.html.haml
deleted file mode 100644
index 7042d07d5e8bbacf6ba445639e92ecf83a722480..0000000000000000000000000000000000000000
--- a/app/views/snippets/edit.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title
- Edit snippet
-%hr
-= render "shared/snippets/form", url: snippet_path(@snippet)
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
deleted file mode 100644
index 5cd8ae26cf9c518bb647ab9876f96d8b815cade1..0000000000000000000000000000000000000000
--- a/app/views/snippets/index.html.haml
+++ /dev/null
@@ -1,17 +0,0 @@
-%h3.page-title
- Public snippets
-
- .pull-right
-
- - if current_user
- = link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do
- Add new snippet
- = link_to user_snippets_path(current_user), class: "btn btn-grouped" do
- Your snippets
-
-%p.light
- Public snippets created by you and other users are listed here
-
-%hr
-= render 'snippets'
-
diff --git a/app/views/snippets/new.html.haml b/app/views/snippets/new.html.haml
deleted file mode 100644
index 694d70583173a69cc826c54d853bf2b51f1a9d8a..0000000000000000000000000000000000000000
--- a/app/views/snippets/new.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-%h3.page-title
- New snippet
-%hr
-= render "shared/snippets/form", url: snippets_path(@snippet)
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
deleted file mode 100644
index 5204fb9a90702aca1d752f00e5567ca60c94a7f9..0000000000000000000000000000000000000000
--- a/app/views/snippets/show.html.haml
+++ /dev/null
@@ -1,43 +0,0 @@
-%h3.page-title
- = @snippet.title
-
- - if @snippet.private?
- %span.label.label-success
- %i.fa.fa-lock
- private
-
- .pull-right
- = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
- Add new snippet
-%hr
-
-.append-bottom-20
- .pull-right
- = "##{@snippet.id}"
- %span.light
- by
- = link_to user_snippets_path(@snippet.author) do
- = image_tag avatar_icon(@snippet.author_email), class: "avatar avatar-inline s16", alt: ''
- = @snippet.author_name
-
- .back-link
- - if @snippet.author == current_user
- = link_to user_snippets_path(current_user) do
- ← your snippets
- - else
- = link_to snippets_path do
- ← discover snippets
-
-.file-holder
- .file-title
- %i.fa.fa-file
- %strong
- = @snippet.file_name
- .file-actions
- .btn-group
- - if can?(current_user, :modify_personal_snippet, @snippet)
- = link_to "edit", edit_snippet_path(@snippet), class: "btn btn-sm", title: 'Edit Snippet'
- = link_to "raw", raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank"
- - if can?(current_user, :admin_personal_snippet, @snippet)
- = link_to "remove", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-sm btn-remove", title: 'Delete Snippet'
- = render 'shared/snippets/blob'
diff --git a/app/views/snippets/user_index.html.haml b/app/views/snippets/user_index.html.haml
deleted file mode 100644
index df524cd18b0cb46b01612a3c6976605dccc336ba..0000000000000000000000000000000000000000
--- a/app/views/snippets/user_index.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%h3.page-title
- = image_tag avatar_icon(@user.email), class: "avatar s24"
- = @user.name
- %span
- \/
- Snippets
- - if current_user
- = link_to new_snippet_path, class: "btn btn-sm add_new pull-right", title: "New Snippet" do
- Add new snippet
-
-%hr
-
-= render 'snippets'
diff --git a/app/views/users/_groups.html.haml b/app/views/users/_groups.html.haml
deleted file mode 100644
index f360fbb3d5d94159871f64e52cf0b9dae86a4886..0000000000000000000000000000000000000000
--- a/app/views/users/_groups.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-.clearfix
- - groups.each do |group|
- = link_to group, class: 'profile-groups-avatars inline', title: group.name do
- = image_tag group_icon(group), class: 'avatar group-avatar s40'
diff --git a/app/views/users/_profile.html.haml b/app/views/users/_profile.html.haml
deleted file mode 100644
index 90d9980c85ca44e9a127a9378f6b7279d5e22694..0000000000000000000000000000000000000000
--- a/app/views/users/_profile.html.haml
+++ /dev/null
@@ -1,31 +0,0 @@
-.panel.panel-default
- .panel-heading
- Profile
- %ul.well-list
- %li
- %span.light Member since
- %strong= user.created_at.stamp("Aug 21, 2011")
- - unless user.public_email.blank?
- %li
- %span.light E-mail:
- %strong= link_to user.public_email, "mailto:#{user.public_email}"
- - unless user.skype.blank?
- %li
- %span.light Skype:
- %strong= link_to user.skype, "skype:#{user.skype}"
- - unless user.linkedin.blank?
- %li
- %span.light LinkedIn:
- %strong= link_to user.linkedin, "http://www.linkedin.com/in/#{user.linkedin}"
- - unless user.twitter.blank?
- %li
- %span.light Twitter:
- %strong= link_to user.twitter, "http://www.twitter.com/#{user.twitter}"
- - unless user.website_url.blank?
- %li
- %span.light Website:
- %strong= link_to user.short_website_url, user.full_website_url
- - unless user.location.blank?
- %li
- %span.light Location:
- %strong= user.location
diff --git a/app/views/users/_projects.html.haml b/app/views/users/_projects.html.haml
deleted file mode 100644
index 297fa53739407271eb9303bb51c9ce827ce59d45..0000000000000000000000000000000000000000
--- a/app/views/users/_projects.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- if local_assigns.has_key?(:contributed_projects) && contributed_projects.present?
- .panel.panel-default.contributed-projects
- .panel-heading Projects contributed to
- = render 'shared/projects_list',
- projects: contributed_projects.sort_by(&:star_count).reverse,
- projects_limit: 5, stars: true, avatar: false
-
-- if local_assigns.has_key?(:projects) && projects.present?
- .panel.panel-default
- .panel-heading Personal projects
- = render 'shared/projects_list',
- projects: projects.sort_by(&:star_count).reverse,
- projects_limit: 10, stars: true, avatar: false
diff --git a/app/views/users/calendar.html.haml b/app/views/users/calendar.html.haml
deleted file mode 100644
index 922b0c6cebf1cb1425ec056195bc15025cf434d2..0000000000000000000000000000000000000000
--- a/app/views/users/calendar.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-%h4
- Contributions calendar
- .pull-right
- %small Issues, merge requests and push events
-#cal-heatmap.calendar
- :javascript
- new Calendar(
- #{@timestamps.to_json},
- #{@starting_year},
- #{@starting_month},
- '#{user_calendar_activities_path}'
- );
diff --git a/app/views/users/calendar_activities.html.haml b/app/views/users/calendar_activities.html.haml
deleted file mode 100644
index 027a93a75fcd9ba317e1dc0b44c9e1b3035b1321..0000000000000000000000000000000000000000
--- a/app/views/users/calendar_activities.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-%h4.prepend-top-20
- %span.light Contributions for
- %strong #{@calendar_date.to_s(:short)}
-
-%ul.bordered-list
- - @events.sort_by(&:created_at).each do |event|
- %li
- %span.light
- %i.fa.fa-clock-o
- = event.created_at.to_s(:time)
- - if event.push?
- #{event.action_name} #{event.ref_type} #{event.ref_name}
- - else
- = event_action_name(event)
- - if event.target
- %strong= link_to "##{event.target_iid}", [event.project.namespace.becomes(Namespace), event.project, event.target]
-
- at
- %strong
- - if event.project
- = link_to_project event.project
- - else
- = event.project_name
diff --git a/app/views/users/show.atom.builder b/app/views/users/show.atom.builder
deleted file mode 100644
index 8fe30b23635fd58e414485a3a3510c36b135effe..0000000000000000000000000000000000000000
--- a/app/views/users/show.atom.builder
+++ /dev/null
@@ -1,12 +0,0 @@
-xml.instruct!
-xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
- xml.title "Activity feed for #{@user.name}"
- xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml"
- xml.link href: user_url(@user), rel: "alternate", type: "text/html"
- xml.id projects_url
- xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any?
-
- @events.each do |event|
- event_to_atom(xml, event)
- end
-end
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
deleted file mode 100644
index 9dd8cb0738c55bb681aca50603a100e6369d82e2..0000000000000000000000000000000000000000
--- a/app/views/users/show.html.haml
+++ /dev/null
@@ -1,50 +0,0 @@
-.row
- = link_to '#aside', class: 'show-aside' do
- %i.fa.fa-angle-left
- %section.col-md-8
- .header-with-avatar
- = image_tag avatar_icon(@user.email, 90), class: "avatar avatar-tile s90", alt: ''
- %h3
- = @user.name
- - if @user == current_user
- .pull-right
- = link_to profile_path, class: 'btn btn-sm' do
- %i.fa.fa-pencil-square-o
- Edit Profile settings
- .username
- @#{@user.username}
- .description
- - if @user.bio.present?
- = @user.bio
-
- .clearfix
-
- - if @groups.any?
- .prepend-top-20
- %h4 Groups
- = render 'groups', groups: @groups
- %hr
-
- .hidden-xs
- .user-calendar
- %h4.center.light
- %i.fa.fa-spinner.fa-spin
- .user-calendar-activities
- %hr
- %h4
- User Activity
-
- - if current_user
- %span.rss-icon.pull-right
- = link_to user_path(@user, :atom, { private_token: current_user.private_token }) do
- %strong
- %i.fa.fa-rss
-
- .content_list
- = spinner
- %aside.col-md-4
- = render 'profile', user: @user
- = render 'projects', projects: @projects, contributed_projects: @contributed_projects
-
-:coffeescript
- $(".user-calendar").load("#{user_calendar_path}")
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
deleted file mode 100644
index 36ea67420641ee8af1d63bf450107dc4e56f00ba..0000000000000000000000000000000000000000
--- a/app/views/votes/_votes_block.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-.votes.votes-block
- .btn-group
- - unless votable.upvotes.zero?
- .btn.btn-sm.disabled.cgreen
- %i.fa.fa-thumbs-up
- = votable.upvotes
- - unless votable.downvotes.zero?
- .btn.btn-sm.disabled.cred
- %i.fa.fa-thumbs-down
- = votable.downvotes
diff --git a/app/views/votes/_votes_inline.html.haml b/app/views/votes/_votes_inline.html.haml
deleted file mode 100644
index 2cb3ae04e1a83b670b824993ee5a59e1dcf29684..0000000000000000000000000000000000000000
--- a/app/views/votes/_votes_inline.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.votes.votes-inline
- - unless votable.upvotes.zero?
- %span.upvotes.cgreen
- + #{votable.upvotes}
- - unless votable.downvotes.zero?
- \/
- - unless votable.downvotes.zero?
- %span.downvotes.cred
- \- #{votable.downvotes}
diff --git a/app/workers/auto_merge_worker.rb b/app/workers/auto_merge_worker.rb
deleted file mode 100644
index a6dd73eee5f81c8cff509d63b2294c0b05ae26a0..0000000000000000000000000000000000000000
--- a/app/workers/auto_merge_worker.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class AutoMergeWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :default
-
- def perform(merge_request_id, current_user_id, params)
- params = params.with_indifferent_access
- current_user = User.find(current_user_id)
- merge_request = MergeRequest.find(merge_request_id)
- merge_request.should_remove_source_branch = params[:should_remove_source_branch]
- merge_request.automerge!(current_user, params[:commit_message])
- end
-end
diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb
deleted file mode 100644
index 1d21addece6df43d48a79a6c0e5d478c47e06ef3..0000000000000000000000000000000000000000
--- a/app/workers/emails_on_push_worker.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-class EmailsOnPushWorker
- include Sidekiq::Worker
-
- def perform(project_id, recipients, push_data, options = {})
- options.symbolize_keys!
- options.reverse_merge!(
- send_from_committer_email: false,
- disable_diffs: false
- )
- send_from_committer_email = options[:send_from_committer_email]
- disable_diffs = options[:disable_diffs]
-
- project = Project.find(project_id)
- before_sha = push_data["before"]
- after_sha = push_data["after"]
- ref = push_data["ref"]
- author_id = push_data["user_id"]
-
- action =
- if Gitlab::Git.blank_ref?(before_sha)
- :create
- elsif Gitlab::Git.blank_ref?(after_sha)
- :delete
- else
- :push
- end
-
- compare = nil
- reverse_compare = false
- if action == :push
- compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha)
-
- return false if compare.same
-
- if compare.commits.empty?
- compare = Gitlab::Git::Compare.new(project.repository.raw_repository, after_sha, before_sha)
-
- reverse_compare = true
-
- return false if compare.commits.empty?
- end
- end
-
- recipients.split(" ").each do |recipient|
- Notify.repository_push_email(
- project_id,
- recipient,
- author_id: author_id,
- ref: ref,
- action: action,
- compare: compare,
- reverse_compare: reverse_compare,
- send_from_committer_email: send_from_committer_email,
- disable_diffs: disable_diffs
- ).deliver
- end
- ensure
- compare = nil
- GC.start
- end
-end
diff --git a/app/workers/fork_registration_worker.rb b/app/workers/fork_registration_worker.rb
deleted file mode 100644
index fffa8b3a65913c12759c76c604ee8d10967f7c1b..0000000000000000000000000000000000000000
--- a/app/workers/fork_registration_worker.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-class ForkRegistrationWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :default
-
- def perform(from_project_id, to_project_id, private_token)
- from_project = Project.find(from_project_id)
- to_project = Project.find(to_project_id)
-
- from_project.gitlab_ci_service.fork_registration(to_project, private_token)
- end
-end
diff --git a/app/workers/gitlab_shell_worker.rb b/app/workers/gitlab_shell_worker.rb
deleted file mode 100644
index cfeda88bbc5c6ceaef5d19215cf32b1dc77aa131..0000000000000000000000000000000000000000
--- a/app/workers/gitlab_shell_worker.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-class GitlabShellWorker
- include Sidekiq::Worker
- include Gitlab::ShellAdapter
-
- sidekiq_options queue: :gitlab_shell
-
- def perform(action, *arg)
- gitlab_shell.send(action, *arg)
- end
-end
diff --git a/app/workers/irker_worker.rb b/app/workers/irker_worker.rb
deleted file mode 100644
index 8b50f423984f8f452b0c8ada50d6250143a6d7fb..0000000000000000000000000000000000000000
--- a/app/workers/irker_worker.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-require 'json'
-require 'socket'
-
-class IrkerWorker
- include Sidekiq::Worker
-
- def perform(project_id, chans, colors, push_data, settings)
- project = Project.find(project_id)
-
- # Get config parameters
- return false unless init_perform settings, chans, colors
-
- repo_name = push_data['repository']['name']
- committer = push_data['user_name']
- branch = push_data['ref'].gsub(%r'refs/[^/]*/', '')
-
- if @colors
- repo_name = "\x0304#{repo_name}\x0f"
- branch = "\x0305#{branch}\x0f"
- end
-
- # Firsts messages are for branch creation/deletion
- send_branch_updates push_data, project, repo_name, committer, branch
-
- # Next messages are for commits
- send_commits push_data, project, repo_name, committer, branch
-
- close_connection
- true
- end
-
- private
-
- def init_perform(set, chans, colors)
- @colors = colors
- @channels = chans
- start_connection set['server_ip'], set['server_port']
- end
-
- def start_connection(irker_server, irker_port)
- begin
- @socket = TCPSocket.new irker_server, irker_port
- rescue Errno::ECONNREFUSED => e
- logger.fatal "Can't connect to Irker daemon: #{e}"
- return false
- end
- true
- end
-
- def sendtoirker(privmsg)
- to_send = { to: @channels, privmsg: privmsg }
- @socket.puts JSON.dump(to_send)
- end
-
- def close_connection
- @socket.close
- end
-
- def send_branch_updates(push_data, project, repo_name, committer, branch)
- if Gitlab::Git.blank_ref?(push_data['before'])
- send_new_branch project, repo_name, committer, branch
- elsif Gitlab::Git.blank_ref?(push_data['after'])
- send_del_branch repo_name, committer, branch
- end
- end
-
- def send_new_branch(project, repo_name, committer, branch)
- repo_path = project.path_with_namespace
- newbranch = "#{Gitlab.config.gitlab.url}/#{repo_path}/branches"
- newbranch = "\x0302\x1f#{newbranch}\x0f" if @colors
-
- privmsg = "[#{repo_name}] #{committer} has created a new branch "
- privmsg += "#{branch}: #{newbranch}"
- sendtoirker privmsg
- end
-
- def send_del_branch(repo_name, committer, branch)
- privmsg = "[#{repo_name}] #{committer} has deleted the branch #{branch}"
- sendtoirker privmsg
- end
-
- def send_commits(push_data, project, repo_name, committer, branch)
- return if push_data['total_commits_count'] == 0
-
- # Next message is for number of commit pushed, if any
- if Gitlab::Git.blank_ref?(push_data['before'])
- # Tweak on push_data["before"] in order to have a nice compare URL
- push_data['before'] = before_on_new_branch push_data, project
- end
-
- send_commits_count(push_data, project, repo_name, committer, branch)
-
- # One message per commit, limited by 3 messages (same limit as the
- # github irc hook)
- commits = push_data['commits'].first(3)
- commits.each do |hook_attrs|
- send_one_commit project, hook_attrs, repo_name, branch
- end
- end
-
- def before_on_new_branch(push_data, project)
- commit = commit_from_id project, push_data['commits'][0]['id']
- parents = commit.parents
- # Return old value if there's no new one
- return push_data['before'] if parents.empty?
- # Or return the first parent-commit
- parents[0].id
- end
-
- def send_commits_count(data, project, repo, committer, branch)
- url = compare_url data, project.path_with_namespace
- commits = colorize_commits data['total_commits_count']
-
- new_commits = 'new commit'
- new_commits += 's' if data['total_commits_count'] > 1
-
- sendtoirker "[#{repo}] #{committer} pushed #{commits} #{new_commits} " \
- "to #{branch}: #{url}"
- end
-
- def compare_url(data, repo_path)
- sha1 = Commit::truncate_sha(data['before'])
- sha2 = Commit::truncate_sha(data['after'])
- compare_url = "#{Gitlab.config.gitlab.url}/#{repo_path}/compare"
- compare_url += "/#{sha1}...#{sha2}"
- colorize_url compare_url
- end
-
- def send_one_commit(project, hook_attrs, repo_name, branch)
- commit = commit_from_id project, hook_attrs['id']
- sha = colorize_sha Commit::truncate_sha(hook_attrs['id'])
- author = hook_attrs['author']['name']
- files = colorize_nb_files(files_count commit)
- title = commit.title
-
- sendtoirker "#{repo_name}/#{branch} #{sha} #{author} (#{files}): #{title}"
- end
-
- def commit_from_id(project, id)
- commit = Gitlab::Git::Commit.find(project.repository, id)
- Commit.new(commit)
- end
-
- def files_count(commit)
- files = "#{commit.diffs.count} file"
- files += 's' if commit.diffs.count > 1
- files
- end
-
- def colorize_sha(sha)
- sha = "\x0314#{sha}\x0f" if @colors
- sha
- end
-
- def colorize_nb_files(nb_files)
- nb_files = "\x0312#{nb_files}\x0f" if @colors
- nb_files
- end
-
- def colorize_url(url)
- url = "\x0302\x1f#{url}\x0f" if @colors
- url
- end
-
- def colorize_commits(commits)
- commits = "\x02#{commits}\x0f" if @colors
- commits
- end
-end
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
deleted file mode 100644
index 33d8cc8861be8ebe23b24d1ff1dc4362316dcacd..0000000000000000000000000000000000000000
--- a/app/workers/post_receive.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-class PostReceive
- include Sidekiq::Worker
- include Gitlab::Identifier
-
- sidekiq_options queue: :post_receive
-
- def perform(repo_path, identifier, changes)
- if repo_path.start_with?(Gitlab.config.gitlab_shell.repos_path.to_s)
- repo_path.gsub!(Gitlab.config.gitlab_shell.repos_path.to_s, "")
- else
- log("Check gitlab.yml config for correct gitlab_shell.repos_path variable. \"#{Gitlab.config.gitlab_shell.repos_path}\" does not match \"#{repo_path}\"")
- end
-
- repo_path.gsub!(/\.git\z/, "")
- repo_path.gsub!(/\A\//, "")
-
- project = Project.find_with_namespace(repo_path)
-
- if project.nil?
- log("Triggered hook for non-existing project with full path \"#{repo_path} \"")
- return false
- end
-
- changes = Base64.decode64(changes) unless changes.include?(" ")
- changes = utf8_encode_changes(changes)
- changes = changes.lines
-
- changes.each do |change|
- oldrev, newrev, ref = change.strip.split(' ')
-
- @user ||= identify(identifier, project, newrev)
-
- unless @user
- log("Triggered hook for non-existing user \"#{identifier} \"")
- return false
- end
-
- if Gitlab::Git.tag_ref?(ref)
- GitTagPushService.new.execute(project, @user, oldrev, newrev, ref)
- else
- GitPushService.new.execute(project, @user, oldrev, newrev, ref)
- end
- end
- end
-
- def utf8_encode_changes(changes)
- changes = changes.dup
-
- changes.force_encoding("UTF-8")
- return changes if changes.valid_encoding?
-
- # Convert non-UTF-8 branch/tag names to UTF-8 so they can be dumped as JSON.
- detection = CharlockHolmes::EncodingDetector.detect(changes)
- return changes unless detection && detection[:encoding]
-
- CharlockHolmes::Converter.convert(changes, detection[:encoding], 'UTF-8')
- end
-
- def log(message)
- Gitlab::GitLogger.error("POST-RECEIVE: #{message}")
- end
-end
diff --git a/app/workers/project_service_worker.rb b/app/workers/project_service_worker.rb
deleted file mode 100644
index 64d39c4d3f7ef436cb4ee49e2a2d4d9a5a5ee72a..0000000000000000000000000000000000000000
--- a/app/workers/project_service_worker.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-class ProjectServiceWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :project_web_hook
-
- def perform(hook_id, data)
- data = data.with_indifferent_access
- Service.find(hook_id).execute(data)
- end
-end
diff --git a/app/workers/project_web_hook_worker.rb b/app/workers/project_web_hook_worker.rb
deleted file mode 100644
index 73085c046bd6ab50ab3183a7178ab196939f3ad9..0000000000000000000000000000000000000000
--- a/app/workers/project_web_hook_worker.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-class ProjectWebHookWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :project_web_hook
-
- def perform(hook_id, data)
- data = data.with_indifferent_access
- WebHook.find(hook_id).execute(data)
- end
-end
diff --git a/app/workers/repository_archive_worker.rb b/app/workers/repository_archive_worker.rb
deleted file mode 100644
index 021c1139568b8bfc5ca6b259d57bb16bbaab5d7f..0000000000000000000000000000000000000000
--- a/app/workers/repository_archive_worker.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-class RepositoryArchiveWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :archive_repo
-
- attr_accessor :project, :ref, :format
-
- def perform(project_id, ref, format)
- @project = Project.find(project_id)
- @ref, @format = ref, format.downcase
-
- repository = project.repository
-
- repository.clean_old_archives
-
- return unless file_path
- return if archived? || archiving?
-
- repository.archive_repo(ref, storage_path, format)
- end
-
- private
-
- def storage_path
- Gitlab.config.gitlab.repository_downloads_path
- end
-
- def file_path
- @file_path ||= project.repository.archive_file_path(ref, storage_path, format)
- end
-
- def pid_file_path
- @pid_file_path ||= project.repository.archive_pid_file_path(ref, storage_path, format)
- end
-
- def archived?
- File.exist?(file_path)
- end
-
- def archiving?
- File.exist?(pid_file_path)
- end
-end
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb
deleted file mode 100644
index e6a50afedb12003bb99c3ebb09056097767733c3..0000000000000000000000000000000000000000
--- a/app/workers/repository_import_worker.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-class RepositoryImportWorker
- include Sidekiq::Worker
- include Gitlab::ShellAdapter
-
- sidekiq_options queue: :gitlab_shell
-
- def perform(project_id)
- project = Project.find(project_id)
-
- import_result = gitlab_shell.send(:import_repository,
- project.path_with_namespace,
- project.import_url)
- return project.import_fail unless import_result
-
- data_import_result = if project.import_type == 'github'
- Gitlab::GithubImport::Importer.new(project).execute
- elsif project.import_type == 'gitlab'
- Gitlab::GitlabImport::Importer.new(project).execute
- elsif project.import_type == 'bitbucket'
- Gitlab::BitbucketImport::Importer.new(project).execute
- elsif project.import_type == 'google_code'
- Gitlab::GoogleCodeImport::Importer.new(project).execute
- else
- true
- end
- return project.import_fail unless data_import_result
-
- project.import_finish
- project.save
- project.satellite.create unless project.satellite.exists?
- project.update_repository_size
- Gitlab::BitbucketImport::KeyDeleter.new(project).execute if project.import_type == 'bitbucket'
- end
-end
diff --git a/app/workers/system_hook_worker.rb b/app/workers/system_hook_worker.rb
deleted file mode 100644
index 3ebc62b7e7a5a890d01f65b492b14ba6b76d60aa..0000000000000000000000000000000000000000
--- a/app/workers/system_hook_worker.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class SystemHookWorker
- include Sidekiq::Worker
-
- sidekiq_options queue: :system_hook
-
- def perform(hook_id, data)
- SystemHook.find(hook_id).execute data
- end
-end
diff --git a/bin/background_jobs b/bin/background_jobs
deleted file mode 100755
index a041a4b0433b292aa3785d089b5e909a4e1400ea..0000000000000000000000000000000000000000
--- a/bin/background_jobs
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-cd $(dirname $0)/..
-app_root=$(pwd)
-sidekiq_pidfile="$app_root/tmp/pids/sidekiq.pid"
-sidekiq_logfile="$app_root/log/sidekiq.log"
-gitlab_user=$(ls -l config.ru | awk '{print $3}')
-
-warn()
-{
- echo "$@" 1>&2
-}
-
-stop()
-{
- bundle exec sidekiqctl stop $sidekiq_pidfile >> $sidekiq_logfile 2>&1
-}
-
-killall()
-{
- pkill -u $gitlab_user -f 'sidekiq [0-9]'
-}
-
-restart()
-{
- if [ -f $sidekiq_pidfile ]; then
- stop
- fi
- killall
- start_sidekiq -d -L $sidekiq_logfile
-}
-
-start_no_deamonize()
-{
- start_sidekiq
-}
-
-start_sidekiq()
-{
- bundle exec sidekiq -q post_receive -q mailer -q archive_repo -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e $RAILS_ENV -P $sidekiq_pidfile $@ >> $sidekiq_logfile 2>&1
-}
-
-load_ok()
-{
- sidekiq_pid=$(cat $sidekiq_pidfile)
- if [ -z "$sidekiq_pid" ] ; then
- warn "Could not find a PID in $sidekiq_pidfile"
- exit 0
- fi
-
- if (ps -p $sidekiq_pid -o args | grep '\([0-9]\+\) of \1 busy' 1>&2) ; then
- warn "Too many busy Sidekiq workers"
- exit 1
- fi
-
- exit 0
-}
-
-case "$1" in
- stop)
- stop
- ;;
- start)
- restart
- ;;
- start_no_deamonize)
- start_no_deamonize
- ;;
- restart)
- restart
- ;;
- killall)
- killall
- ;;
- load_ok)
- load_ok
- ;;
- *)
- echo "Usage: RAILS_ENV=your_env $0 {stop|start|start_no_deamonize|restart|killall|load_ok}"
-esac
diff --git a/bin/bundle b/bin/bundle
deleted file mode 100755
index 66e9889e8b4aeea1af13e2396fb70594232a2ae3..0000000000000000000000000000000000000000
--- a/bin/bundle
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/check b/bin/check
deleted file mode 100755
index c907a98b5d91d15915256870a73985d58c5cda5d..0000000000000000000000000000000000000000
--- a/bin/check
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
diff --git a/bin/guard b/bin/guard
deleted file mode 100755
index 0c1a532bd01d7e797faaba230577d39c57f31208..0000000000000000000000000000000000000000
--- a/bin/guard
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by Bundler.
-#
-# The application 'guard' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
-
-require 'rubygems'
-require 'bundler/setup'
-
-load Gem.bin_path('guard', 'guard')
diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh
deleted file mode 100755
index 5a2007f4ab0ba511d3b3d6e9cf987709811387a1..0000000000000000000000000000000000000000
--- a/bin/pkgr_before_precompile.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-for file in config/*.yml.example; do
- cp ${file} config/$(basename ${file} .example)
-done
-
-# Allow to override the Gitlab URL from an environment variable, as this will avoid having to change the configuration file for simple deployments.
-config=$(echo '<% gitlab_url = URI(ENV["GITLAB_URL"] || "http://localhost:80") %>' | cat - config/gitlab.yml)
-echo "$config" > config/gitlab.yml
-sed -i "s/host: localhost/host: <%= gitlab_url.host %>/" config/gitlab.yml
-sed -i "s/port: 80/port: <%= gitlab_url.port %>/" config/gitlab.yml
-sed -i "s/https: false/https: <%= gitlab_url.scheme == 'https' %>/" config/gitlab.yml
-
-# No need for config file. Will be taken care of by REDIS_URL env variable
-rm config/resque.yml
-
-# Set default unicorn.rb file
-echo "" > config/unicorn.rb
diff --git a/bin/rails b/bin/rails
deleted file mode 100755
index 7feb6a30e696bf9b94f204c6abb5c4d75f965046..0000000000000000000000000000000000000000
--- a/bin/rails
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-begin
- load File.expand_path("../spring", __FILE__)
-rescue LoadError
-end
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-require_relative '../config/boot'
-require 'rails/commands'
diff --git a/bin/rake b/bin/rake
deleted file mode 100755
index 8017a0271d2130252500c4ef0f5bdf3b39582480..0000000000000000000000000000000000000000
--- a/bin/rake
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-begin
- load File.expand_path("../spring", __FILE__)
-rescue LoadError
-end
-require_relative '../config/boot'
-require 'rake'
-Rake.application.run
diff --git a/bin/rspec b/bin/rspec
deleted file mode 100755
index 20060ebd79c0ec217596c425ddc66ea58b4a02d1..0000000000000000000000000000000000000000
--- a/bin/rspec
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-begin
- load File.expand_path("../spring", __FILE__)
-rescue LoadError
-end
-require 'bundler/setup'
-load Gem.bin_path('rspec-core', 'rspec')
diff --git a/bin/spinach b/bin/spinach
deleted file mode 100755
index a080e286cfe025ec2c80934395e9020c1c1f9812..0000000000000000000000000000000000000000
--- a/bin/spinach
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-begin
- load File.expand_path("../spring", __FILE__)
-rescue LoadError
-end
-require 'bundler/setup'
-load Gem.bin_path('spinach', 'spinach')
diff --git a/bin/spring b/bin/spring
deleted file mode 100755
index 253ec37c3451d65eb54c64d59cdeaf41a1c8aafc..0000000000000000000000000000000000000000
--- a/bin/spring
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-
-# This file loads spring without using Bundler, in order to be fast
-# It gets overwritten when you run the `spring binstub` command
-
-unless defined?(Spring)
- require "rubygems"
- require "bundler"
-
- if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
- ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
- ENV["GEM_HOME"] = ""
- Gem.paths = ENV
-
- gem "spring", match[1]
- require "spring/binstub"
- end
-end
diff --git a/bin/upgrade.rb b/bin/upgrade.rb
deleted file mode 100644
index a5caecf8526e8b08dbc2ba4880bbc85d46c2635e..0000000000000000000000000000000000000000
--- a/bin/upgrade.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-require_relative "../lib/gitlab/upgrader"
-
-Gitlab::Upgrader.new.execute
diff --git a/bin/web b/bin/web
deleted file mode 100755
index 67f236eb0bb67005d69c99164629dfeb914f9d36..0000000000000000000000000000000000000000
--- a/bin/web
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-cd $(dirname $0)/..
-app_root=$(pwd)
-
-unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
-unicorn_config="$app_root/config/unicorn.rb"
-
-get_unicorn_pid()
-{
- local pid=$(cat $unicorn_pidfile)
- if [ -z "$pid" ] ; then
- echo "Could not find a PID in $unicorn_pidfile"
- exit 1
- fi
- unicorn_pid=$pid
-}
-
-start()
-{
- bundle exec unicorn_rails -D -c $unicorn_config -E $RAILS_ENV
-}
-
-stop()
-{
- get_unicorn_pid
- kill -QUIT $unicorn_pid
-}
-
-reload()
-{
- get_unicorn_pid
- kill -USR2 $unicorn_pid
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- reload)
- reload
- ;;
- *)
- echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}"
- ;;
-esac
diff --git a/config.ru b/config.ru
deleted file mode 100644
index e90863a5c21baf365868b4ad325c88cd52338949..0000000000000000000000000000000000000000
--- a/config.ru
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is used by Rack-based servers to start the application.
-
-if defined?(Unicorn)
- require 'unicorn'
- # Unicorn self-process killer
- require 'unicorn/worker_killer'
-
- # Max memory size (RSS) per worker
- use Unicorn::WorkerKiller::Oom, (200 * (1 << 20)), (250 * (1 << 20))
-end
-
-require ::File.expand_path('../config/environment', __FILE__)
-
-map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
- run Gitlab::Application
-end
diff --git a/config/application.rb b/config/application.rb
deleted file mode 100644
index fa399533e523cf81a9a77b779d5ecfac2f4697e9..0000000000000000000000000000000000000000
--- a/config/application.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-require File.expand_path('../boot', __FILE__)
-
-require 'rails/all'
-require 'devise'
-I18n.config.enforce_available_locales = false
-Bundler.require(:default, Rails.env)
-
-module Gitlab
- class Application < Rails::Application
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
-
- # Custom directories with classes and modules you want to be autoloadable.
- config.autoload_paths.push(*%W(#{config.root}/lib
- #{config.root}/app/models/hooks
- #{config.root}/app/models/concerns
- #{config.root}/app/models/project_services
- #{config.root}/app/models/members))
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named.
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
- config.i18n.enforce_available_locales = false
-
- # Configure the default encoding used in templates for Ruby 1.9.
- config.encoding = "utf-8"
-
- # Configure sensitive parameters which will be filtered from the log file.
- config.filter_parameters.push(:password, :password_confirmation, :private_token)
-
- # Enable escaping HTML in JSON.
- config.active_support.escape_html_entities_in_json = true
-
- # Use SQL instead of Active Record's schema dumper when creating the database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-
- # Enable the asset pipeline
- config.assets.enabled = true
- config.assets.paths << Emoji.images_path
- config.assets.precompile << "emoji/*.png"
- config.assets.precompile << "print.css"
-
- # Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
-
- config.action_view.sanitized_allowed_protocols = %w(smb)
-
- # Relative url support
- # Uncomment and customize the last line to run in a non-root path
- # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.
- # Note that following settings need to be changed for this to work.
- # 1) In your application.rb file: config.relative_url_root = "/gitlab"
- # 2) In your gitlab.yml file: relative_url_root: /gitlab
- # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
- # 4) In ../gitlab-shell/config.yml: gitlab_url: "http://127.0.0.1/gitlab"
- # 5) In lib/support/nginx/gitlab : do not use asset gzipping, remove block starting with "location ~ ^/(assets)/"
- #
- # To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
- #
- # config.relative_url_root = "/gitlab"
-
- config.middleware.use Rack::Attack
-
- # Allow access to GitLab API from other domains
- config.middleware.use Rack::Cors do
- allow do
- origins '*'
- resource '/api/*',
- headers: :any,
- methods: [:get, :post, :options, :put, :delete],
- expose: ['Link']
- end
- end
-
- # Use Redis caching across all environments
- redis_config_file = Rails.root.join('config', 'resque.yml')
-
- redis_url_string = if File.exists?(redis_config_file)
- YAML.load_file(redis_config_file)[Rails.env]
- else
- "redis://localhost:6379"
- end
-
- # Redis::Store does not handle Unix sockets well, so let's do it for them
- redis_config_hash = Redis::Store::Factory.extract_host_options_from_uri(redis_url_string)
- redis_uri = URI.parse(redis_url_string)
- if redis_uri.scheme == 'unix'
- redis_config_hash[:path] = redis_uri.path
- end
-
- redis_config_hash[:namespace] = 'cache:gitlab'
- config.cache_store = :redis_store, redis_config_hash
-
- # This is needed for gitlab-shell
- ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH']
- end
-end
diff --git a/config/aws.yml.example b/config/aws.yml.example
deleted file mode 100644
index 29d029b078d6eb3271f84212cd6493bc7b2f8765..0000000000000000000000000000000000000000
--- a/config/aws.yml.example
+++ /dev/null
@@ -1,19 +0,0 @@
-# See https://github.com/jnicklas/carrierwave#using-amazon-s3
-# for more options
-production:
- access_key_id: AKIA1111111111111UA
- secret_access_key: secret
- bucket: mygitlab.production.us
- region: us-east-1
-
-development:
- access_key_id: AKIA1111111111111UA
- secret_access_key: secret
- bucket: mygitlab.development.us
- region: us-east-1
-
-test:
- access_key_id: AKIA1111111111111UA
- secret_access_key: secret
- bucket: mygitlab.test.us
- region: us-east-1
diff --git a/config/boot.rb b/config/boot.rb
deleted file mode 100644
index 4489e58688ca642d8e0e9489f6896f49f9b89da6..0000000000000000000000000000000000000000
--- a/config/boot.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/database.yml.mysql b/config/database.yml.mysql
deleted file mode 100644
index a99c50706c511a62a71e719bf35f3cc0dcf0625a..0000000000000000000000000000000000000000
--- a/config/database.yml.mysql
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# PRODUCTION
-#
-production:
- adapter: mysql2
- encoding: utf8
- collation: utf8_general_ci
- reconnect: false
- database: gitlabhq_production
- pool: 10
- username: git
- password: "secure password"
- # host: localhost
- # socket: /tmp/mysql.sock
-
-#
-# Development specific
-#
-development:
- adapter: mysql2
- encoding: utf8
- collation: utf8_general_ci
- reconnect: false
- database: gitlabhq_development
- pool: 5
- username: root
- password: "secure password"
- # socket: /tmp/mysql.sock
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: mysql2
- encoding: utf8
- collation: utf8_general_ci
- reconnect: false
- database: gitlabhq_test
- pool: 5
- username: root
- password:
- # socket: /tmp/mysql.sock
diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
deleted file mode 100644
index 7067e0fe402ca956d0a644f201990db673809d67..0000000000000000000000000000000000000000
--- a/config/database.yml.postgresql
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# PRODUCTION
-#
-production:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_production
- pool: 10
- # username: git
- # password:
- # host: localhost
- # port: 5432
-
-#
-# Development specific
-#
-development:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_development
- pool: 5
- username: postgres
- password:
-
-#
-# Staging specific
-#
-staging:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_staging
- pool: 5
- username: postgres
- password:
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_test
- pool: 5
- username: postgres
- password:
diff --git a/config/environment.rb b/config/environment.rb
deleted file mode 100644
index 3b186a9d57afddfdae94306877719d2b98ea1945..0000000000000000000000000000000000000000
--- a/config/environment.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Load the rails application
-require File.expand_path('../application', __FILE__)
-
-# Initialize the rails application
-Gitlab::Application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
deleted file mode 100644
index 03af7f078648d3bf133ef61d277d543020ae2c8b..0000000000000000000000000000000000000000
--- a/config/environments/development.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-Gitlab::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the web server when you make code changes.
- config.cache_classes = false
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Don't care if the mailer can't send
- config.action_mailer.raise_delivery_errors = false
-
- # Print deprecation notices to the Rails logger
- config.active_support.deprecation = :log
-
- # Only use best-standards-support built into browsers
- config.action_dispatch.best_standards_support = :builtin
-
- # Do not compress assets
- config.assets.compress = false
-
- # Expands the lines which load the assets
- # config.assets.debug = true
-
- # For having correct urls in mails
- config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
- # Open sent mails in browser
- config.action_mailer.delivery_method = :letter_opener
-
- config.eager_load = false
-end
diff --git a/config/environments/production.rb b/config/environments/production.rb
deleted file mode 100644
index 3316ece387398bf8188c9a5fb0aee12315483f50..0000000000000000000000000000000000000000
--- a/config/environments/production.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-Gitlab::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # Code is not reloaded between requests
- config.cache_classes = true
-
- # Full error reports are disabled and caching is turned on
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
-
- # Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
-
- # Compress JavaScripts and CSS.
- config.assets.js_compressor = :uglifier
- # config.assets.css_compressor = :sass
-
- # Don't fallback to assets pipeline if a precompiled asset is missed
- config.assets.compile = true
-
- # Generate digests for assets URLs
- config.assets.digest = true
-
- # Defaults to nil and saved in location specified by config.assets.prefix
- # config.assets.manifest = YOUR_PATH
-
- # Specifies the header that your server uses for sending files
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
-
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
- # config.force_ssl = true
-
- # See everything in the log (default is :info)
- # config.log_level = :debug
-
- # Suppress 'Rendered template ...' messages in the log
- # source: http://stackoverflow.com/a/16369363
- %w{render_template render_partial render_collection}.each do |event|
- ActiveSupport::Notifications.unsubscribe "#{event}.action_view"
- end
-
- # Prepend all log lines with the following tags
- # config.log_tags = [ :subdomain, :uuid ]
-
- # Use a different logger for distributed setups
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
-
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
- # config.action_controller.asset_host = "http://assets.example.com"
-
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- # config.assets.precompile += %w( search.js )
-
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
-
- # Enable threaded mode
- # config.threadsafe! unless $rails_rake_task
-
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation can not be found)
- config.i18n.fallbacks = true
-
- # Send deprecation notices to registered listeners
- config.active_support.deprecation = :notify
-
- config.action_mailer.delivery_method = :sendmail
- # Defaults to:
- # # config.action_mailer.sendmail_settings = {
- # # location: '/usr/sbin/sendmail',
- # # arguments: '-i -t'
- # # }
- config.action_mailer.perform_deliveries = true
- config.action_mailer.raise_delivery_errors = true
-
- config.eager_load = true
-
- config.allow_concurrency = false
-end
diff --git a/config/environments/test.rb b/config/environments/test.rb
deleted file mode 100644
index 2d5e7addcd3ebe1b6d3dc5661e962c6790415370..0000000000000000000000000000000000000000
--- a/config/environments/test.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-Gitlab::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
- # your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
- config.cache_classes = false
-
- # Configure static asset server for tests with Cache-Control for performance
- config.serve_static_assets = true
- config.static_cache_control = "public, max-age=3600"
-
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Raise exceptions instead of rendering exception templates
- config.action_dispatch.show_exceptions = false
-
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
-
- # Tell Action Mailer not to deliver emails to the real world.
- # The :test delivery method accumulates sent emails in the
- # ActionMailer::Base.deliveries array.
- config.action_mailer.delivery_method = :test
-
- # Print deprecation notices to the stderr
- config.active_support.deprecation = :stderr
-
- config.eager_load = false
-end
diff --git a/config/gitlab.teatro.yml b/config/gitlab.teatro.yml
deleted file mode 100644
index f0656400beb00c2dc9fc82bc2be41235a9504340..0000000000000000000000000000000000000000
--- a/config/gitlab.teatro.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-production: &base
- gitlab:
- host: localhost
- port: 80
- https: false
-
- user: root
-
- email_from: example@example.com
-
- support_email: support@example.com
-
- default_projects_features:
- issues: true
- merge_requests: true
- wiki: true
- wall: false
- snippets: false
- visibility_level: "private" # can be "private" | "internal" | "public"
-
- issues_tracker:
-
- gravatar:
- enabled: true # Use user avatar image from Gravatar.com (default: true)
-
- ldap:
- enabled: false
- host: '_your_ldap_server'
- port: 636
- uid: 'sAMAccountName'
- method: 'ssl' # "tls" or "ssl" or "plain"
- bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
- password: '_the_password_of_the_bind_user'
- allow_username_or_email_login: true
-
- base: ''
-
- user_filter: ''
-
- omniauth:
- enabled: false
-
- satellites:
- # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
- path: /apps/gitlab-satellites/
-
- backup:
- path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
-
- gitlab_shell:
- path: /apps/gitlab-shell/
-
- # REPOS_PATH MUST NOT BE A SYMLINK!!!
- repos_path: /apps/repositories/
- hooks_path: /apps/gitlab-shell/hooks/
-
- upload_pack: true
- receive_pack: true
-
- git:
- bin_path: /usr/bin/git
- max_size: 5242880 # 5.megabytes
- timeout: 10
-
- extra:
-
-development:
- <<: *base
-
-test:
- <<: *base
- gravatar:
- enabled: true
- gitlab:
- host: localhost
- port: 80
- issues_tracker:
- redmine:
- title: "Redmine"
- project_url: "http://redmine/projects/:issues_tracker_id"
- issues_url: "http://redmine/:project_id/:issues_tracker_id/:id"
- new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new"
-
-staging:
- <<: *base
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
deleted file mode 100644
index ba40671b162cd36e320de9012ac0242da9d286eb..0000000000000000000000000000000000000000
--- a/config/gitlab.yml.example
+++ /dev/null
@@ -1,337 +0,0 @@
-# # # # # # # # # # # # # # # # # #
-# GitLab application config file #
-# # # # # # # # # # # # # # # # # #
-#
-########################### NOTE #####################################
-# This file should not receive new settings. All configuration options #
-# are being moved to ApplicationSetting model! #
-########################################################################
-#
-# How to use:
-# 1. Copy file as gitlab.yml
-# 2. Update gitlab -> host with your fully qualified domain name
-# 3. Update gitlab -> email_from
-# 4. If you installed Git from source, change git -> bin_path to /usr/local/bin/git
-# 5. Review this configuration file for other settings you may want to adjust
-
-production: &base
- #
- # 1. GitLab app settings
- # ==========================
-
- ## GitLab settings
- gitlab:
- ## Web server settings (note: host is the FQDN, do not include http://)
- host: localhost
- port: 80 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
- https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
-
- # Uncommment this line below if your ssh host is different from HTTP/HTTPS one
- # (you'd obviously need to replace ssh.host_example.com with your own host).
- # Otherwise, ssh host will be set to the `host:` value above
- # ssh_host: ssh.host_example.com
-
- # WARNING: See config/application.rb under "Relative url support" for the list of
- # other files that need to be changed for relative url support
- # relative_url_root: /gitlab
-
- # Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
- # user: git
-
- ## Date & Time settings
- # Uncomment and customize if you want to change the default time zone of GitLab application.
- # To see all available zones, run `bundle exec rake time:zones:all RAILS_ENV=production`
- # time_zone: 'UTC'
-
- ## Email settings
- # Uncomment and set to false if you need to disable email sending from GitLab (default: true)
- # email_enabled: true
- # Email address used in the "From" field in mails sent by GitLab
- email_from: example@example.com
- email_display_name: GitLab
- email_reply_to: noreply@example.com
-
- # Email server smtp settings are in config/initializers/smtp_settings.rb.sample
-
- # default_can_create_group: false # default: true
- # username_changing_enabled: false # default: true - User can change her username/namespace
- ## Default theme
- ## BASIC = 1
- ## MARS = 2
- ## MODERN = 3
- ## GRAY = 4
- ## COLOR = 5
- # default_theme: 2 # default: 2
-
- ## Automatic issue closing
- # If a commit message matches this regular expression, all issues referenced from the matched text will be closed.
- # This happens when the commit is pushed or merged into the default branch of a project.
- # When not specified the default issue_closing_pattern as specified below will be used.
- # Tip: you can test your closing pattern at http://rubular.com.
- # issue_closing_pattern: '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?#\d+(?:(?:, *| +and +)?))+)'
-
- ## Default project features settings
- default_projects_features:
- issues: true
- merge_requests: true
- wiki: true
- snippets: false
- visibility_level: "private" # can be "private" | "internal" | "public"
-
- ## Webhook settings
- # Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10)
- # webhook_timeout: 10
-
- ## Repository downloads directory
- # When a user clicks e.g. 'Download zip' on a project, a temporary zip file is created in the following directory.
- # The default is 'tmp/repositories' relative to the root of the Rails app.
- # repository_downloads_path: tmp/repositories
-
- ## Gravatar
- ## For Libravatar see: http://doc.gitlab.com/ce/customization/libravatar.html
- gravatar:
- enabled: true # Use user avatar image from Gravatar.com (default: true)
- # gravatar urls: possible placeholders: %{hash} %{size} %{email}
- # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon
- # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon
-
- #
- # 2. Auth settings
- # ==========================
-
- ## LDAP settings
- # You can inspect a sample of the LDAP users with login access by running:
- # bundle exec rake gitlab:ldap:check RAILS_ENV=production
- ldap:
- enabled: false
- servers:
- ##########################################################################
- #
- # Since GitLab 7.4, LDAP servers get ID's (below the ID is 'main'). GitLab
- # Enterprise Edition now supports connecting to multiple LDAP servers.
- #
- # If you are updating from the old (pre-7.4) syntax, you MUST give your
- # old server the ID 'main'.
- #
- ##########################################################################
- main: # 'main' is the GitLab 'provider ID' of this LDAP server
- ## label
- #
- # A human-friendly name for your LDAP server. It is OK to change the label later,
- # for instance if you find out it is too large to fit on the web page.
- #
- # Example: 'Paris' or 'Acme, Ltd.'
- label: 'LDAP'
-
- host: '_your_ldap_server'
- port: 389
- uid: 'sAMAccountName'
- method: 'plain' # "tls" or "ssl" or "plain"
- bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
- password: '_the_password_of_the_bind_user'
-
- # This setting specifies if LDAP server is Active Directory LDAP server.
- # For non AD servers it skips the AD specific queries.
- # If your LDAP server is not AD, set this to false.
- active_directory: true
-
- # If allow_username_or_email_login is enabled, GitLab will ignore everything
- # after the first '@' in the LDAP username submitted by the user on login.
- #
- # Example:
- # - the user enters 'jane.doe@example.com' and 'p@ssw0rd' as LDAP credentials;
- # - GitLab queries the LDAP server with 'jane.doe' and 'p@ssw0rd'.
- #
- # If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to
- # disable this setting, because the userPrincipalName contains an '@'.
- allow_username_or_email_login: false
-
- # To maintain tight control over the number of active users on your GitLab installation,
- # enable this setting to keep new users blocked until they have been cleared by the admin
- # (default: false).
- block_auto_created_users: false
-
- # Base where we can search for users
- #
- # Ex. ou=People,dc=gitlab,dc=example
- #
- base: ''
-
- # Filter LDAP users
- #
- # Format: RFC 4515 http://tools.ietf.org/search/rfc4515
- # Ex. (employeeType=developer)
- #
- # Note: GitLab does not support omniauth-ldap's custom filter syntax.
- #
- user_filter: ''
-
- # GitLab EE only: add more LDAP servers
- # Choose an ID made of a-z and 0-9 . This ID will be stored in the database
- # so that GitLab can remember which LDAP server a user belongs to.
- # uswest2:
- # label:
- # host:
- # ....
-
-
- ## OmniAuth settings
- omniauth:
- # Allow login via Twitter, Google, etc. using OmniAuth providers
- enabled: false
-
- # CAUTION!
- # This allows users to login without having a user account first (default: false).
- # User accounts will be created automatically when authentication was successful.
- allow_single_sign_on: false
- # Locks down those users until they have been cleared by the admin (default: true).
- block_auto_created_users: true
-
- ## Auth providers
- # Uncomment the following lines and fill in the data of the auth provider you want to use
- # If your favorite auth provider is not listed you can use others:
- # see https://github.com/gitlabhq/gitlab-public-wiki/wiki/Custom-omniauth-provider-configurations
- # The 'app_id' and 'app_secret' parameters are always passed as the first two
- # arguments, followed by optional 'args' which can be either a hash or an array.
- # Documentation for this is available at http://doc.gitlab.com/ce/integration/omniauth.html
- providers:
- # - { name: 'google_oauth2', app_id: 'YOUR_APP_ID',
- # app_secret: 'YOUR_APP_SECRET',
- # args: { access_type: 'offline', approval_prompt: '' } }
- # - { name: 'twitter', app_id: 'YOUR_APP_ID',
- # app_secret: 'YOUR_APP_SECRET'}
- # - { name: 'github', app_id: 'YOUR_APP_ID',
- # app_secret: 'YOUR_APP_SECRET',
- # args: { scope: 'user:email' } }
- # - { name: 'gitlab', app_id: 'YOUR_APP_ID',
- # app_secret: 'YOUR_APP_SECRET',
- # args: { scope: 'api' } }
- # - { name: 'bitbucket', app_id: 'YOUR_APP_ID',
- # app_secret: 'YOUR_APP_SECRET'}
-
-
-
- #
- # 3. Advanced settings
- # ==========================
-
- # GitLab Satellites
- satellites:
- # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
- path: /home/git/gitlab-satellites/
- timeout: 30
-
- ## Backup settings
- backup:
- path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
- # keep_time: 604800 # default: 0 (forever) (in seconds)
- # upload:
- # # Fog storage connection settings, see http://fog.io/storage/ .
- # connection:
- # provider: AWS
- # region: eu-west-1
- # aws_access_key_id: AKIAKIAKI
- # aws_secret_access_key: 'secret123'
- # # The remote 'directory' to store your backups. For S3, this would be the bucket name.
- # remote_directory: 'my.s3.bucket'
-
- ## GitLab Shell settings
- gitlab_shell:
- path: /home/git/gitlab-shell/
-
- # REPOS_PATH MUST NOT BE A SYMLINK!!!
- repos_path: /home/git/repositories/
- hooks_path: /home/git/gitlab-shell/hooks/
-
- # Git over HTTP
- upload_pack: true
- receive_pack: true
-
- # If you use non-standard ssh port you need to specify it
- # ssh_port: 22
-
- ## Git settings
- # CAUTION!
- # Use the default values unless you really know what you are doing
- git:
- bin_path: /usr/bin/git
- # The next value is the maximum memory size grit can use
- # Given in number of bytes per git object (e.g. a commit)
- # This value can be increased if you have very large commits
- max_size: 20971520 # 20.megabytes
- # Git timeout to read a commit, in seconds
- timeout: 10
-
- #
- # 4. Extra customization
- # ==========================
-
- extra:
- ## Google analytics. Uncomment if you want it
- # google_analytics_id: '_your_tracking_id'
-
- ## Piwik analytics.
- # piwik_url: '_your_piwik_url'
- # piwik_site_id: '_your_piwik_site_id'
-
- rack_attack:
- git_basic_auth:
- # Rack Attack IP banning enabled
- # enabled: true
- #
- # Whitelist requests from 127.0.0.1 for web proxies (NGINX/Apache) with incorrect headers
- # ip_whitelist: ["127.0.0.1"]
- #
- # Limit the number of Git HTTP authentication attempts per IP
- # maxretry: 10
- #
- # Reset the auth attempt counter per IP after 60 seconds
- # findtime: 60
- #
- # Ban an IP for one hour (3600s) after too many auth attempts
- # bantime: 3600
-
-development:
- <<: *base
-
-test:
- <<: *base
- gravatar:
- enabled: true
- gitlab:
- host: localhost
- port: 80
-
- # When you run tests we clone and setup gitlab-shell
- # In order to setup it correctly you need to specify
- # your system username you use to run GitLab
- # user: YOUR_USERNAME
- satellites:
- path: tmp/tests/gitlab-satellites/
- gitlab_shell:
- path: tmp/tests/gitlab-shell/
- repos_path: tmp/tests/repositories/
- hooks_path: tmp/tests/gitlab-shell/hooks/
- issues_tracker:
- redmine:
- title: "Redmine"
- project_url: "http://redmine/projects/:issues_tracker_id"
- issues_url: "http://redmine/:project_id/:issues_tracker_id/:id"
- new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new"
- ldap:
- enabled: false
- servers:
- main:
- label: ldap
- host: 127.0.0.1
- port: 3890
- uid: 'uid'
- method: 'plain' # "tls" or "ssl" or "plain"
- base: 'dc=example,dc=com'
- user_filter: ''
- group_base: 'ou=groups,dc=example,dc=com'
- admin_group: ''
- sync_ssh_keys: false
-
-staging:
- <<: *base
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
deleted file mode 100644
index 0abd34fc3e0a013e729418084e0b2a89e5750e22..0000000000000000000000000000000000000000
--- a/config/initializers/1_settings.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-require 'gitlab' # Load lib/gitlab.rb as soon as possible
-
-class Settings < Settingslogic
- source ENV.fetch('GITLAB_CONFIG') { "#{Rails.root}/config/gitlab.yml" }
- namespace Rails.env
-
- class << self
- def gitlab_on_standard_port?
- gitlab.port.to_i == (gitlab.https ? 443 : 80)
- end
-
- private
-
- def build_gitlab_shell_ssh_path_prefix
- if gitlab_shell.ssh_port != 22
- "ssh://#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:#{gitlab_shell.ssh_port}/"
- else
- if gitlab_shell.ssh_host.include? ':'
- "[#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}]:"
- else
- "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:"
- end
- end
- end
-
- def build_gitlab_url
- custom_port = gitlab_on_standard_port? ? nil : ":#{gitlab.port}"
- [ gitlab.protocol,
- "://",
- gitlab.host,
- custom_port,
- gitlab.relative_url_root
- ].join('')
- end
-
- # check that values in `current` (string or integer) is a contant in `modul`.
- def verify_constant_array(modul, current, default)
- values = default || []
- if !current.nil?
- values = []
- current.each do |constant|
- values.push(verify_constant(modul, constant, nil))
- end
- values.delete_if { |value| value.nil? }
- end
- values
- end
-
- # check that `current` (string or integer) is a contant in `modul`.
- def verify_constant(modul, current, default)
- constant = modul.constants.find{ |name| modul.const_get(name) == current }
- value = constant.nil? ? default : modul.const_get(constant)
- if current.is_a? String
- value = modul.const_get(current.upcase) rescue default
- end
- value
- end
- end
-end
-
-
-# Default settings
-Settings['ldap'] ||= Settingslogic.new({})
-Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
-
-# backwards compatibility, we only have one host
-if Settings.ldap['enabled'] || Rails.env.test?
- if Settings.ldap['host'].present?
- # We detected old LDAP configuration syntax. Update the config to make it
- # look like it was entered with the new syntax.
- server = Settings.ldap.except('sync_time')
- Settings.ldap['servers'] = {
- 'main' => server
- }
- end
-
- Settings.ldap['servers'].each do |key, server|
- server['label'] ||= 'LDAP'
- server['block_auto_created_users'] = false if server['block_auto_created_users'].nil?
- server['allow_username_or_email_login'] = false if server['allow_username_or_email_login'].nil?
- server['active_directory'] = true if server['active_directory'].nil?
- server['provider_name'] ||= "ldap#{key}".downcase
- server['provider_class'] = OmniAuth::Utils.camelize(server['provider_name'])
- end
-end
-
-
-Settings['omniauth'] ||= Settingslogic.new({})
-Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil?
-Settings.omniauth['providers'] ||= []
-
-Settings['issues_tracker'] ||= {}
-
-#
-# GitLab
-#
-Settings['gitlab'] ||= Settingslogic.new({})
-Settings.gitlab['default_projects_limit'] ||= 10
-Settings.gitlab['default_branch_protection'] ||= 2
-Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil?
-Settings.gitlab['default_theme'] = Gitlab::Theme::MARS if Settings.gitlab['default_theme'].nil?
-Settings.gitlab['host'] ||= 'localhost'
-Settings.gitlab['ssh_host'] ||= Settings.gitlab.host
-Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
-Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
-Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
-Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
-Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
-Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
-Settings.gitlab['email_display_name'] ||= "GitLab"
-Settings.gitlab['email_reply_to'] ||= "noreply@#{Settings.gitlab.host}"
-Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
-Settings.gitlab['user'] ||= 'git'
-Settings.gitlab['user_home'] ||= begin
- Etc.getpwnam(Settings.gitlab['user']).dir
-rescue ArgumentError # no user configured
- '/home/' + Settings.gitlab['user']
-end
-Settings.gitlab['time_zone'] ||= nil
-Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].nil?
-Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
-Settings.gitlab['twitter_sharing_enabled'] ||= true if Settings.gitlab['twitter_sharing_enabled'].nil?
-Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
-Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
-Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing)) +(?:(?:issues? +)?#\d+(?:(?:, *| +and +)?))+)' if Settings.gitlab['issue_closing_pattern'].nil?
-Settings.gitlab['default_projects_features'] ||= {}
-Settings.gitlab['webhook_timeout'] ||= 10
-Settings.gitlab['max_attachment_size'] ||= 10
-Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
-Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil?
-Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
-Settings.gitlab.default_projects_features['snippets'] = false if Settings.gitlab.default_projects_features['snippets'].nil?
-Settings.gitlab.default_projects_features['visibility_level'] = Settings.send(:verify_constant, Gitlab::VisibilityLevel, Settings.gitlab.default_projects_features['visibility_level'], Gitlab::VisibilityLevel::PRIVATE)
-Settings.gitlab['repository_downloads_path'] = File.absolute_path(Settings.gitlab['repository_downloads_path'] || 'tmp/repositories', Rails.root)
-
-#
-# Gravatar
-#
-Settings['gravatar'] ||= Settingslogic.new({})
-Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
-Settings.gravatar['plain_url'] ||= 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
-Settings.gravatar['ssl_url'] ||= 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
-
-#
-# GitLab Shell
-#
-Settings['gitlab_shell'] ||= Settingslogic.new({})
-Settings.gitlab_shell['path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/'
-Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitlab-shell/hooks/'
-Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil?
-Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil?
-Settings.gitlab_shell['repos_path'] ||= Settings.gitlab['user_home'] + '/repositories/'
-Settings.gitlab_shell['ssh_host'] ||= Settings.gitlab.ssh_host
-Settings.gitlab_shell['ssh_port'] ||= 22
-Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user
-Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user
-Settings.gitlab_shell['ssh_path_prefix'] ||= Settings.send(:build_gitlab_shell_ssh_path_prefix)
-
-#
-# Backup
-#
-Settings['backup'] ||= Settingslogic.new({})
-Settings.backup['keep_time'] ||= 0
-Settings.backup['path'] = File.expand_path(Settings.backup['path'] || "tmp/backups/", Rails.root)
-Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'connection' => nil })
-# Convert upload connection settings to use symbol keys, to make Fog happy
-if Settings.backup['upload']['connection']
- Settings.backup['upload']['connection'] = Hash[Settings.backup['upload']['connection'].map { |k, v| [k.to_sym, v] }]
-end
-
-#
-# Git
-#
-Settings['git'] ||= Settingslogic.new({})
-Settings.git['max_size'] ||= 20971520 # 20.megabytes
-Settings.git['bin_path'] ||= '/usr/bin/git'
-Settings.git['timeout'] ||= 10
-
-Settings['satellites'] ||= Settingslogic.new({})
-Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)
-Settings.satellites['timeout'] ||= 30
-
-#
-# Extra customization
-#
-Settings['extra'] ||= Settingslogic.new({})
-
-#
-# Rack::Attack settings
-#
-Settings['rack_attack'] ||= Settingslogic.new({})
-Settings.rack_attack['git_basic_auth'] ||= Settingslogic.new({})
-Settings.rack_attack.git_basic_auth['enabled'] = true if Settings.rack_attack.git_basic_auth['enabled'].nil?
-Settings.rack_attack.git_basic_auth['ip_whitelist'] ||= %w{127.0.0.1}
-Settings.rack_attack.git_basic_auth['maxretry'] ||= 10
-Settings.rack_attack.git_basic_auth['findtime'] ||= 1.minute
-Settings.rack_attack.git_basic_auth['bantime'] ||= 1.hour
-
-#
-# Testing settings
-#
-if Rails.env.test?
- Settings.gitlab['default_projects_limit'] = 42
- Settings.gitlab['default_can_create_group'] = true
- Settings.gitlab['default_can_create_team'] = false
-end
diff --git a/config/initializers/2_app.rb b/config/initializers/2_app.rb
deleted file mode 100644
index 688cdf5f4b0887eb23bcdfdf41a2c51719eb329b..0000000000000000000000000000000000000000
--- a/config/initializers/2_app.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-module Gitlab
- VERSION = File.read(Rails.root.join("VERSION")).strip
- REVISION = Gitlab::Popen.popen(%W(git log --pretty=format:%h -n 1)).first.chomp
-
- def self.config
- Settings
- end
-end
diff --git a/config/initializers/3_grit_ext.rb b/config/initializers/3_grit_ext.rb
deleted file mode 100644
index 6540ac839cb1e5242678ee25b35b129c4bee8237..0000000000000000000000000000000000000000
--- a/config/initializers/3_grit_ext.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'grit'
-
-Grit::Git.git_binary = Gitlab.config.git.bin_path
-Grit::Git.git_timeout = Gitlab.config.git.timeout
-Grit::Git.git_max_size = Gitlab.config.git.max_size
diff --git a/config/initializers/4_sidekiq.rb b/config/initializers/4_sidekiq.rb
deleted file mode 100644
index e856499732e949334e401a6740846f1d706ba24b..0000000000000000000000000000000000000000
--- a/config/initializers/4_sidekiq.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# Custom Redis configuration
-config_file = Rails.root.join('config', 'resque.yml')
-
-resque_url = if File.exists?(config_file)
- YAML.load_file(config_file)[Rails.env]
- else
- "redis://localhost:6379"
- end
-
-Sidekiq.configure_server do |config|
- config.redis = {
- url: resque_url,
- namespace: 'resque:gitlab'
- }
-
- config.server_middleware do |chain|
- chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS']
- chain.add Gitlab::SidekiqMiddleware::MemoryKiller if ENV['SIDEKIQ_MEMORY_KILLER_MAX_RSS']
- end
-end
-
-Sidekiq.configure_client do |config|
- config.redis = {
- url: resque_url,
- namespace: 'resque:gitlab'
- }
-end
diff --git a/config/initializers/5_backend.rb b/config/initializers/5_backend.rb
deleted file mode 100644
index 80d641d73a37ae8d385131711095ccfcb3542412..0000000000000000000000000000000000000000
--- a/config/initializers/5_backend.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# GIT over HTTP
-require Rails.root.join("lib", "gitlab", "backend", "grack_auth")
-
-# GIT over SSH
-require Rails.root.join("lib", "gitlab", "backend", "shell")
-
-# GitLab shell adapter
-require Rails.root.join("lib", "gitlab", "backend", "shell_adapter")
-
-required_version = Gitlab::VersionInfo.parse(Gitlab::Shell.version_required)
-current_version = Gitlab::VersionInfo.parse(Gitlab::Shell.new.version)
-
-unless current_version.valid? && required_version <= current_version
- warn "WARNING: This version of GitLab depends on gitlab-shell #{required_version}, but you're running #{current_version}. Please update gitlab-shell."
-end
diff --git a/config/initializers/6_rack_profiler.rb b/config/initializers/6_rack_profiler.rb
deleted file mode 100644
index b634028756925661e59683bd908b5140275504ef..0000000000000000000000000000000000000000
--- a/config/initializers/6_rack_profiler.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-if Rails.env == 'development'
- require 'rack-mini-profiler'
-
- # initialization is skipped so trigger it
- Rack::MiniProfilerRails.initialize!(Rails.application)
- Rack::MiniProfiler.config.position = 'right'
- Rack::MiniProfiler.config.start_hidden = true
-end
diff --git a/config/initializers/7_omniauth.rb b/config/initializers/7_omniauth.rb
deleted file mode 100644
index 8f6c5673103de9d4feea06b2b42be6aa37130120..0000000000000000000000000000000000000000
--- a/config/initializers/7_omniauth.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-if Gitlab::LDAP::Config.enabled?
- module OmniAuth::Strategies
- server = Gitlab.config.ldap.servers.values.first
- klass = server['provider_class']
- const_set(klass, Class.new(LDAP)) unless klass == 'LDAP'
- end
-
- OmniauthCallbacksController.class_eval do
- server = Gitlab.config.ldap.servers.values.first
- alias_method server['provider_name'], :ldap
- end
-end
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
deleted file mode 100644
index 59385cdf379bd06a8d2326dcd4de6d5cd5d3f5b0..0000000000000000000000000000000000000000
--- a/config/initializers/backtrace_silencers.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
deleted file mode 100644
index bfb8656df552da088bf7848deaa77540945bead2..0000000000000000000000000000000000000000
--- a/config/initializers/carrierwave.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
-
-aws_file = Rails.root.join('config', 'aws.yml')
-
-if File.exists?(aws_file)
- AWS_CONFIG = YAML.load(File.read(aws_file))[Rails.env]
-
- CarrierWave.configure do |config|
- config.fog_credentials = {
- provider: 'AWS', # required
- aws_access_key_id: AWS_CONFIG['access_key_id'], # required
- aws_secret_access_key: AWS_CONFIG['secret_access_key'], # required
- region: AWS_CONFIG['region'], # optional, defaults to 'us-east-1'
- }
-
- # required
- config.fog_directory = AWS_CONFIG['bucket']
-
- # optional, defaults to true
- config.fog_public = false
-
- # optional, defaults to {}
- config.fog_attributes = { 'Cache-Control'=>'max-age=315576000' }
-
- # optional time (in seconds) that authenticated urls will be valid.
- # when fog_public is false and provider is AWS or Google, defaults to 600
- config.fog_authenticated_url_expiration = 1 << 29
- end
-
- # Mocking Fog requests, based on: https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3A-Test-Fog-based-uploaders
- if Rails.env.test?
- Fog.mock!
- connection = ::Fog::Storage.new(
- aws_access_key_id: AWS_CONFIG['access_key_id'],
- aws_secret_access_key: AWS_CONFIG['secret_access_key'],
- provider: 'AWS',
- region: AWS_CONFIG['region']
- )
- connection.directories.create(key: AWS_CONFIG['bucket'])
- end
-end
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
deleted file mode 100644
index 9dce495106f50cd4167eb3c4e4aa941aad6f8f66..0000000000000000000000000000000000000000
--- a/config/initializers/devise.rb
+++ /dev/null
@@ -1,246 +0,0 @@
-# Use this hook to configure devise mailer, warden hooks and so forth. The first
-# four configuration values can also be set straight in your models.
-Devise.setup do |config|
- # ==> Mailer Configuration
- # Configure the e-mail address which will be shown in Devise::Mailer,
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
- config.mailer_sender = "GitLab <#{Gitlab.config.gitlab.email_from}>"
-
-
- # Configure the class responsible to send e-mails.
- # config.mailer = "Devise::Mailer"
-
- # ==> ORM configuration
- # Load and configure the ORM. Supports :active_record (default) and
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
- # available as additional gems.
- require 'devise/orm/active_record'
-
- # ==> Configuration for any authentication mechanism
- # Configure which keys are used when authenticating a user. The default is
- # just :email. You can configure it to use [:username, :subdomain], so for
- # authenticating a user, both parameters are required. Remember that those
- # parameters are used only when authenticating and not when retrieving from
- # session. If you need permissions, you should implement that in a before filter.
- # You can also supply a hash where the value is a boolean determining whether
- # or not authentication should be aborted when the value is not present.
- config.authentication_keys = [ :login ]
-
- # Configure parameters from the request object used for authentication. Each entry
- # given should be a request method and it will automatically be passed to the
- # find_for_authentication method and considered in your model lookup. For instance,
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
- # The same considerations mentioned for authentication_keys also apply to request_keys.
- # config.request_keys = []
-
- # Configure which authentication keys should be case-insensitive.
- # These keys will be downcased upon creating or modifying a user and when used
- # to authenticate or find a user. Default is :email.
- config.case_insensitive_keys = [ :email ]
-
- # Configure which authentication keys should have whitespace stripped.
- # These keys will have whitespace before and after removed upon creating or
- # modifying a user and when used to authenticate or find a user. Default is :email.
- config.strip_whitespace_keys = [ :email ]
-
- # Tell if authentication through request.params is enabled. True by default.
- # config.params_authenticatable = true
-
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
- # config.http_authenticatable = false
-
- # If http headers should be returned for AJAX requests. True by default.
- # config.http_authenticatable_on_xhr = true
-
- # The realm used in Http Basic Authentication. "Application" by default.
- # config.http_authentication_realm = "Application"
-
- config.reconfirmable = true
-
- # It will change confirmation, password recovery and other workflows
- # to behave the same regardless if the e-mail provided was right or wrong.
- # Does not affect registerable.
- # config.paranoid = true
-
- # ==> Configuration for :database_authenticatable
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
- # using other encryptors, it sets how many times you want the password re-encrypted.
- #
- # Limiting the stretches to just one in testing will increase the performance of
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
- # a value less than 10 in other environments.
- config.stretches = Rails.env.test? ? 1 : 10
-
- # Setup a pepper to generate the encrypted password.
- # config.pepper = "2ef62d549c4ff98a5d3e0ba211e72cff592060247e3bbbb9f499af1222f876f53d39b39b823132affb32858168c79c1d7741d26499901b63c6030a42129924ef"
-
- # ==> Configuration for :confirmable
- # The time you want to give a user to confirm their account. During this time
- # they will be able to access your application without confirming. Default is 0.days
- # When allow_unconfirmed_access_for is zero, the user won't be able to sign in without confirming.
- # You can use this to let your user access some features of your application
- # without confirming the account, but blocking it after a certain period
- # (ie 2 days).
- # config.allow_unconfirmed_access_for = 2.days
-
- # Defines which key will be used when confirming an account
- # config.confirmation_keys = [ :email ]
-
- # ==> Configuration for :rememberable
- # The time the user will be remembered without asking for credentials again.
- # config.remember_for = 2.weeks
-
- # If true, a valid remember token can be re-used between multiple browsers.
- # config.remember_across_browsers = true
-
- # If true, extends the user's remember period when remembered via cookie.
- # config.extend_remember_period = false
-
- # Options to be passed to the created cookie. For instance, you can set
- # secure: true in order to force SSL only cookies.
- # config.cookie_options = {}
-
- # ==> Configuration for :validatable
- # Range for password length. Default is 6..128.
- config.password_length = 8..128
-
- # Email regex used to validate email formats. It simply asserts that
- # an one (and only one) @ exists in the given string. This is mainly
- # to give user feedback and not to assert the e-mail validity.
- # config.email_regexp = /\A[^@]+@[^@]+\z/
-
- # ==> Configuration for :timeoutable
- # The time you want to timeout the user session without activity. After this
- # time the user will be asked for credentials again. Default is 30 minutes.
- # config.timeout_in = 30.minutes
-
- # ==> Configuration for :lockable
- # Defines which strategy will be used to lock an account.
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
- # :none = No lock strategy. You should handle locking by yourself.
- config.lock_strategy = :failed_attempts
-
- # Defines which key will be used when locking and unlocking an account
- # config.unlock_keys = [ :email ]
-
- # Defines which strategy will be used to unlock an account.
- # :email = Sends an unlock link to the user email
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
- # :both = Enables both strategies
- # :none = No unlock strategy. You should handle unlocking by yourself.
- config.unlock_strategy = :time
-
- # Number of authentication tries before locking an account if lock_strategy
- # is failed attempts.
- config.maximum_attempts = 10
-
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
- config.unlock_in = 10.minutes
-
- # ==> Configuration for :recoverable
- #
- # Defines which key will be used when recovering the password for an account
- # config.reset_password_keys = [ :email ]
-
- # Time interval you can reset your password with a reset password key.
- # Don't put a too small interval or your users won't have the time to
- # change their passwords.
- # When someone else invites you to GitLab this time is also used so it should be pretty long.
- config.reset_password_within = 2.days
-
- # ==> Configuration for :encryptable
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
- # REST_AUTH_SITE_KEY to pepper)
- # config.encryptor = :sha512
-
- # Authentication through token does not store user in session and needs
- # to be supplied on each request. Useful if you are using the token as API token.
- config.skip_session_storage << :token_auth
-
- # ==> Scopes configuration
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
- # "users/sessions/new". It's turned off by default because it's slower if you
- # are using only default views.
- # config.scoped_views = false
-
- # Configure the default scope given to Warden. By default it's the first
- # devise role declared in your routes (usually :user).
- # config.default_scope = :user
-
- # Configure sign_out behavior.
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
- # The default is true, which means any logout action will sign out all active scopes.
- # config.sign_out_all_scopes = true
-
- # ==> Navigation configuration
- # Lists the formats that should be treated as navigational. Formats like
- # :html, should redirect to the sign in page when the user does not have
- # access, but formats like :xml or :json, should return 401.
- #
- # If you have any extra navigational formats, like :iphone or :mobile, you
- # should add them to the navigational formats lists.
- #
- # The :"*/*" and "*/*" formats below is required to match Internet
- # Explorer requests.
- # config.navigational_formats = [:"*/*", "*/*", :html]
-
- # The default HTTP method used to sign out a resource. Default is :delete.
- config.sign_out_via = :delete
-
- # ==> OmniAuth
- # To configure a new OmniAuth provider copy and edit omniauth.rb.sample
- # selecting the provider you require.
- # Check the wiki for more information on setting up on your models
-
- # ==> Warden configuration
- # If you want to use other strategies, that are not supported by Devise, or
- # change the failure app, you can configure them inside the config.warden block.
- #
- # config.warden do |manager|
- # manager.failure_app = AnotherApp
- # manager.intercept_401 = false
- # manager.default_strategies(scope: :user).unshift :some_external_strategy
- # end
-
- if Gitlab::LDAP::Config.enabled?
- Gitlab.config.ldap.servers.values.each do |server|
- if server['allow_username_or_email_login']
- email_stripping_proc = ->(name) {name.gsub(/@.*\z/,'')}
- else
- email_stripping_proc = ->(name) {name}
- end
-
- config.omniauth server['provider_name'],
- host: server['host'],
- base: server['base'],
- uid: server['uid'],
- port: server['port'],
- method: server['method'],
- bind_dn: server['bind_dn'],
- password: server['password'],
- name_proc: email_stripping_proc
- end
- end
-
- Gitlab.config.omniauth.providers.each do |provider|
- provider_arguments = []
-
- %w[app_id app_secret].each do |argument|
- provider_arguments << provider[argument] if provider[argument]
- end
-
- case provider['args']
- when Array
- # An Array from the configuration will be expanded.
- provider_arguments.concat provider['args']
- when Hash
- # A Hash from the configuration will be passed as is.
- provider_arguments << provider['args']
- end
-
- config.omniauth provider['name'].to_sym, *provider_arguments
- end
-end
diff --git a/config/initializers/devise_async.rb b/config/initializers/devise_async.rb
deleted file mode 100644
index 05a1852cdbd9d141a757755983adc59ad467f3ca..0000000000000000000000000000000000000000
--- a/config/initializers/devise_async.rb
+++ /dev/null
@@ -1 +0,0 @@
-Devise::Async.backend = :sidekiq
diff --git a/config/initializers/devise_password_length.rb.example b/config/initializers/devise_password_length.rb.example
deleted file mode 100644
index 97305825e07ccf9c7fd29e60c227168fd548ee64..0000000000000000000000000000000000000000
--- a/config/initializers/devise_password_length.rb.example
+++ /dev/null
@@ -1,6 +0,0 @@
-Devise.setup do |config|
- # The following line changes the password length limits for new users. In the
- # example below the minimum length is 12 characters, and the maximum length
- # is 128 characters.
- config.password_length = 12..128
-end
diff --git a/config/initializers/disable_email_interceptor.rb b/config/initializers/disable_email_interceptor.rb
deleted file mode 100644
index c76a6b8b19f51dbd1a6855eb171cc0b725e58863..0000000000000000000000000000000000000000
--- a/config/initializers/disable_email_interceptor.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# Interceptor in lib/disable_email_interceptor.rb
-ActionMailer::Base.register_interceptor(DisableEmailInterceptor) unless Gitlab.config.gitlab.email_enabled
diff --git a/config/initializers/gitlab_shell_secret_token.rb b/config/initializers/gitlab_shell_secret_token.rb
deleted file mode 100644
index e7c9f0ba7c2b8025bcc520cc307c5e05edd3a01b..0000000000000000000000000000000000000000
--- a/config/initializers/gitlab_shell_secret_token.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-require 'securerandom'
-
-# Your secret key for verifying the gitlab_shell.
-
-
-secret_file = Rails.root.join('.gitlab_shell_secret')
-gitlab_shell_symlink = File.join(Gitlab.config.gitlab_shell.path, '.gitlab_shell_secret')
-
-unless File.exist? secret_file
- # Generate a new token of 16 random hexadecimal characters and store it in secret_file.
- token = SecureRandom.hex(16)
- File.write(secret_file, token)
-end
-
-if File.exist?(Gitlab.config.gitlab_shell.path) && !File.exist?(gitlab_shell_symlink)
- FileUtils.symlink(secret_file, gitlab_shell_symlink)
-end
diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb
deleted file mode 100644
index 7e8ddb3716bad55ceaa5fef99c9f2334c8afa07e..0000000000000000000000000000000000000000
--- a/config/initializers/haml.rb
+++ /dev/null
@@ -1 +0,0 @@
-Haml::Template.options[:ugly] = true
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
deleted file mode 100644
index 5d46ece1e1b27791215a48e141697abc40860dbb..0000000000000000000000000000000000000000
--- a/config/initializers/inflections.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
-
-# Mark "commits" as uncountable.
-#
-# Without this change, the routes
-#
-# resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
-# resources :commits, only: [:show], constraints: {id: /.+/}
-#
-# would generate identical route helper methods (`project_commit_path`), resulting
-# in one of them not getting a helper method at all.
-#
-# After this change, the helper methods are:
-#
-# project_commit_path(@project, @project.commit)
-# # => "/gitlabhq/commit/bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a
-#
-# project_commits_path(@project, 'stable/README.md')
-# # => "/gitlabhq/commits/stable/README.md"
-ActiveSupport::Inflector.inflections do |inflect|
- inflect.uncountable %w(commits)
-end
diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb
deleted file mode 100644
index 3cbe9a058d7f0fc2480b692269335b4ee33ac6b2..0000000000000000000000000000000000000000
--- a/config/initializers/kaminari_config.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-Kaminari.configure do |config|
- config.default_per_page = 20
- config.max_per_page = 100
- # config.window = 4
- # config.outer_window = 0
- # config.left = 0
- # config.right = 0
- # config.page_method_name = :page
- # config.param_name = :page
-end
diff --git a/config/initializers/postgresql_limit_fix.rb b/config/initializers/postgresql_limit_fix.rb
deleted file mode 100644
index 0cb3aaf4d24c9b674d23cfa352850c3f7ff0ee1c..0000000000000000000000000000000000000000
--- a/config/initializers/postgresql_limit_fix.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-if defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
- class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
- class TableDefinition
- def text(*args)
- options = args.extract_options!
- options.delete(:limit)
- column_names = args
- type = :text
- column_names.each { |name| column(name, type, options) }
- end
- end
-
- def add_column_with_limit_filter(table_name, column_name, type, options = {})
- options.delete(:limit) if type == :text
- add_column_without_limit_filter(table_name, column_name, type, options)
- end
-
- def change_column_with_limit_filter(table_name, column_name, type, options = {})
- options.delete(:limit) if type == :text
- change_column_without_limit_filter(table_name, column_name, type, options)
- end
-
- alias_method_chain :add_column, :limit_filter
- alias_method_chain :change_column, :limit_filter
- end
-end
diff --git a/config/initializers/public_key.rb b/config/initializers/public_key.rb
deleted file mode 100644
index e4f09a2d02058d36952d667b866e2ff603942d42..0000000000000000000000000000000000000000
--- a/config/initializers/public_key.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-path = File.expand_path("~/.ssh/bitbucket_rsa.pub")
-Gitlab::BitbucketImport.public_key = File.read(path) if File.exist?(path)
diff --git a/config/initializers/rack_attack.rb.example b/config/initializers/rack_attack.rb.example
deleted file mode 100644
index 332865d2881a0a3ad868356cbc4da107ba9ded3e..0000000000000000000000000000000000000000
--- a/config/initializers/rack_attack.rb.example
+++ /dev/null
@@ -1,26 +0,0 @@
-# 1. Rename this file to rack_attack.rb
-# 2. Review the paths_to_be_protected and add any other path you need protecting
-#
-
-paths_to_be_protected = [
- "#{Rails.application.config.relative_url_root}/users/password",
- "#{Rails.application.config.relative_url_root}/users/sign_in",
- "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json",
- "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session",
- "#{Rails.application.config.relative_url_root}/users",
- "#{Rails.application.config.relative_url_root}/users/confirmation",
- "#{Rails.application.config.relative_url_root}/unsubscribes/"
-
-]
-
-# Create one big regular expression that matches strings starting with any of
-# the paths_to_be_protected.
-paths_regex = Regexp.union(paths_to_be_protected.map { |path| /\A#{Regexp.escape(path)}/ })
-
-unless Rails.env.test?
- Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req|
- if req.post? && req.path =~ paths_regex
- req.ip
- end
- end
-end
diff --git a/config/initializers/rack_attack_git_basic_auth.rb b/config/initializers/rack_attack_git_basic_auth.rb
deleted file mode 100644
index bbbfed6832923cb41e94d2defe0af74843bf77a4..0000000000000000000000000000000000000000
--- a/config/initializers/rack_attack_git_basic_auth.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-unless Rails.env.test?
- # Tell the Rack::Attack Rack middleware to maintain an IP blacklist. We will
- # update the blacklist from Grack::Auth#authenticate_user.
- Rack::Attack.blacklist('Git HTTP Basic Auth') do |req|
- Rack::Attack::Allow2Ban.filter(req.ip, Gitlab.config.rack_attack.git_basic_auth) do
- # This block only gets run if the IP was not already banned.
- # Return false, meaning that we do not see anything wrong with the
- # request at this time
- false
- end
- end
-end
diff --git a/config/initializers/redis-store-fix-expiry.rb b/config/initializers/redis-store-fix-expiry.rb
deleted file mode 100644
index fce0a13533012e92babfbb1dca780ad3b84932ff..0000000000000000000000000000000000000000
--- a/config/initializers/redis-store-fix-expiry.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Monkey-patch Redis::Store to make 'setex' and 'expire' work with namespacing
-
-module Gitlab
- class Redis
- class Store
- module Namespace
- # Redis::Store#setex in redis-store 1.1.4 does not respect namespaces;
- # this new method does.
- def setex(key, expires_in, value, options=nil)
- namespace(key) { |key| super(key, expires_in, value) }
- end
-
- # Redis::Store#expire in redis-store 1.1.4 does not respect namespaces;
- # this new method does.
- def expire(key, expires_in)
- namespace(key) { |key| super(key, expires_in) }
- end
-
- private
-
- # Our new definitions of #setex and #expire above assume that the
- # #namespace method exists. Because we cannot be sure of that, we
- # re-implement the #namespace method from Redis::Store::Namespace so
- # that it is available for all Redis::Store instances, whether they use
- # namespacing or not.
- #
- # Based on lib/redis/store/namespace.rb L49-51 (redis-store 1.1.4)
- def namespace(key)
- if @namespace
- yield interpolate(key)
- else
- # This Redis::Store instance does not use a namespace so we should
- # just pass through the key.
- yield key
- end
- end
- end
- end
- end
-end
-
-Redis::Store.class_eval do
- include Gitlab::Redis::Store::Namespace
-end
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
deleted file mode 100644
index 62a54bc8c63274b546eb70bdbafbfb6633cb682c..0000000000000000000000000000000000000000
--- a/config/initializers/secret_token.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-require 'securerandom'
-
-# Your secret key for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-
-def find_secure_token
- token_file = Rails.root.join('.secret')
- if ENV.key?('SECRET_KEY_BASE')
- ENV['SECRET_KEY_BASE']
- elsif File.exist? token_file
- # Use the existing token.
- File.read(token_file).chomp
- else
- # Generate a new token of 64 random hexadecimal characters and store it in token_file.
- token = SecureRandom.hex(64)
- File.write(token_file, token)
- token
- end
-end
-
-Gitlab::Application.config.secret_token = find_secure_token
-Gitlab::Application.config.secret_key_base = find_secure_token
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
deleted file mode 100644
index b2d59f1c4b7e005f782d587476888953115c1bf3..0000000000000000000000000000000000000000
--- a/config/initializers/session_store.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-Gitlab::Application.config.session_store(
- :redis_store, # Using the cookie_store would enable session replay attacks.
- servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
- key: '_gitlab_session',
- secure: Gitlab.config.gitlab.https,
- httponly: true,
- expire_after: 1.week,
- path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root
-)
diff --git a/config/initializers/smtp_settings.rb.sample b/config/initializers/smtp_settings.rb.sample
deleted file mode 100644
index f0fe2fdfa43909e794854815b4c9c51b92d83b04..0000000000000000000000000000000000000000
--- a/config/initializers/smtp_settings.rb.sample
+++ /dev/null
@@ -1,22 +0,0 @@
-# To enable smtp email delivery for your GitLab instance do the following:
-# 1. Rename this file to smtp_settings.rb
-# 2. Edit settings inside this file
-# 3. Restart GitLab instance
-#
-# For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html
-#
-
-if Rails.env.production?
- Gitlab::Application.config.action_mailer.delivery_method = :smtp
-
- ActionMailer::Base.smtp_settings = {
- address: "email.server.com",
- port: 456,
- user_name: "smtp",
- password: "123456",
- domain: "gitlab.company.com",
- authentication: :login,
- enable_starttls_auto: true,
- openssl_verify_mode: 'peer' # See ActionMailer documentation for other possible options
- }
-end
diff --git a/config/initializers/state_machine_patch.rb b/config/initializers/state_machine_patch.rb
deleted file mode 100644
index 72d010fa5deab3f48285ad4ab07f1793f6d9c3a2..0000000000000000000000000000000000000000
--- a/config/initializers/state_machine_patch.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# This is a patch to address the issue in https://github.com/pluginaweek/state_machine/issues/251
-# where gem 'state_machine' was not working for Rails 4.1
-module StateMachine
- module Integrations
- module ActiveModel
- public :around_validation
- end
- end
-end
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb
deleted file mode 100644
index d9042c652bb401fa3e1cd473392ca0160747c8c9..0000000000000000000000000000000000000000
--- a/config/initializers/static_files.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-app = Rails.application
-
-if app.config.serve_static_assets
- # The `ActionDispatch::Static` middleware intercepts requests for static files
- # by checking if they exist in the `/public` directory.
- # We're replacing it with our `Gitlab::Middleware::Static` that does the same,
- # except ignoring `/uploads`, letting those go through to the GitLab Rails app.
-
- app.config.middleware.swap(
- ActionDispatch::Static,
- Gitlab::Middleware::Static,
- app.paths["public"].first,
- app.config.static_cache_control
- )
-end
diff --git a/config/initializers/time_zone.rb b/config/initializers/time_zone.rb
deleted file mode 100644
index ee246e67d6687ea88fe0345a852a3902fa2a16bd..0000000000000000000000000000000000000000
--- a/config/initializers/time_zone.rb
+++ /dev/null
@@ -1 +0,0 @@
-Time.zone = Gitlab.config.gitlab.time_zone || Time.zone
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
deleted file mode 100644
index 999df20181e5571fb6a74259eead0899b7ad18a1..0000000000000000000000000000000000000000
--- a/config/initializers/wrap_parameters.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# Be sure to restart your server when you modify this file.
-#
-# This file contains settings for ActionController::ParamsWrapper which
-# is enabled by default.
-
-# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
-ActiveSupport.on_load(:action_controller) do
- wrap_parameters format: [:json]
-end
-
-# Disable root element in JSON by default.
-ActiveSupport.on_load(:active_record) do
- self.include_root_in_json = false
-end
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
deleted file mode 100644
index f3db5b7476e1ab35221fe1e6cfd55d9be6c82492..0000000000000000000000000000000000000000
--- a/config/locales/devise.en.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
-
-en:
- errors:
- messages:
- expired: "has expired, please request a new one"
- not_found: "not found"
- already_confirmed: "was already confirmed, please try signing in"
- not_locked: "was not locked"
- not_saved:
- one: "1 error prohibited this %{resource} from being saved:"
- other: "%{count} errors prohibited this %{resource} from being saved:"
-
- devise:
- failure:
- already_authenticated: 'You are already signed in.'
- unauthenticated: 'You need to sign in before continuing.'
- unconfirmed: 'You have to confirm your account before continuing.'
- locked: 'Your account is locked.'
- not_found_in_database: 'Invalid email or password.'
- invalid: 'Invalid email or password.'
- invalid_token: 'Invalid authentication token.'
- timeout: 'Your session expired, please sign in again to continue.'
- inactive: 'Your account was not activated yet.'
- sessions:
- signed_in: ''
- signed_out: ''
- users_sessions:
- user:
- signed_in: 'Signed in successfully.'
- passwords:
- send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
- updated: 'Your password was changed successfully. You are now signed in.'
- updated_not_active: 'Your password was changed successfully.'
- send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
- confirmations:
- send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
- send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
- confirmed: 'Your account was successfully confirmed. You are now signed in.'
- registrations:
- signed_up: 'Welcome! You have signed up successfully.'
- updated: 'You updated your account successfully.'
- destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
- signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
- signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
- signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
- unlocks:
- send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
- unlocked: 'Your account was successfully unlocked. You are now signed in.'
- send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
- omniauth_callbacks:
- success: 'Successfully authorized from %{kind} account.'
- failure: 'Could not authorize you from %{kind} because "%{reason}".'
- mailer:
- confirmation_instructions:
- subject: 'Confirmation instructions'
- reset_password_instructions:
- subject: 'Reset password instructions'
- unlock_instructions:
- subject: 'Unlock Instructions'
\ No newline at end of file
diff --git a/config/locales/doorkeeper.en.yml b/config/locales/doorkeeper.en.yml
deleted file mode 100644
index c5b6b75e7f6408f07c0b7cd387dfd0675f29341c..0000000000000000000000000000000000000000
--- a/config/locales/doorkeeper.en.yml
+++ /dev/null
@@ -1,73 +0,0 @@
-en:
- activerecord:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- mongoid:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- mongo_mapper:
- errors:
- models:
- application:
- attributes:
- redirect_uri:
- fragment_present: 'cannot contain a fragment.'
- invalid_uri: 'must be a valid URI.'
- relative_uri: 'must be an absolute URI.'
- doorkeeper:
- errors:
- messages:
- # Common error messages
- invalid_request: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.'
- invalid_redirect_uri: 'The redirect uri included is not valid.'
- unauthorized_client: 'The client is not authorized to perform this request using this method.'
- access_denied: 'The resource owner or authorization server denied the request.'
- invalid_scope: 'The requested scope is invalid, unknown, or malformed.'
- server_error: 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.'
- temporarily_unavailable: 'The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.'
-
- #configuration error messages
- credential_flow_not_configured: 'Resource Owner Password Credentials flow failed due to Doorkeeper.configure.resource_owner_from_credentials being unconfigured.'
- resource_owner_authenticator_not_configured: 'Resource Owner find failed due to Doorkeeper.configure.resource_owner_authenticator being unconfiged.'
-
- # Access grant errors
- unsupported_response_type: 'The authorization server does not support this response type.'
-
- # Access token errors
- invalid_client: 'Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.'
- invalid_grant: 'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.'
- unsupported_grant_type: 'The authorization grant type is not supported by the authorization server.'
-
- # Password Access token errors
- invalid_resource_owner: 'The provided resource owner credentials are not valid, or resource owner cannot be found'
-
- invalid_token:
- revoked: "The access token was revoked"
- expired: "The access token expired"
- unknown: "The access token is invalid"
- scopes:
- api: Access your API
-
- flash:
- applications:
- create:
- notice: 'Application created.'
- destroy:
- notice: 'Application deleted.'
- update:
- notice: 'Application updated.'
- authorized_applications:
- destroy:
- notice: 'Application revoked.'
diff --git a/config/locales/en.yml b/config/locales/en.yml
deleted file mode 100644
index f6cfb5efd2ada02443fe7939ad58f9b5922d719e..0000000000000000000000000000000000000000
--- a/config/locales/en.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
- errors:
- messages:
- wrong_size: "is the wrong size (should be %{file_size})"
- size_too_small: "is too small (should be at least %{file_size})"
- size_too_big: "is too big (should be at most %{file_size})"
diff --git a/config/newrelic.yml b/config/newrelic.yml
deleted file mode 100644
index 9ef922a38d9c969e4a98b551e31a785f32d25d7b..0000000000000000000000000000000000000000
--- a/config/newrelic.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-# New Relic configuration file
-#
-# This file is here to make sure the New Relic gem stays
-# quiet by default.
-#
-# To enable and configure New Relic, please use
-# environment variables, e.g. NEW_RELIC_ENABLED=true
-
-production:
- enabled: false
-
-development:
- enabled: false
-
-test:
- enabled: false
diff --git a/config/resque.yml.example b/config/resque.yml.example
deleted file mode 100644
index 347f3599b206927a82efac6118507d4635373425..0000000000000000000000000000000000000000
--- a/config/resque.yml.example
+++ /dev/null
@@ -1,3 +0,0 @@
-development: redis://localhost:6379
-test: redis://localhost:6379
-production: unix:/var/run/redis/redis.sock
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
deleted file mode 100644
index 86a5512e761982b0cfa80edf6ed5a793dece593d..0000000000000000000000000000000000000000
--- a/config/unicorn.rb.example
+++ /dev/null
@@ -1,123 +0,0 @@
-# Sample verbose configuration file for Unicorn (not Rack)
-#
-# This configuration file documents many features of Unicorn
-# that may not be needed for some applications. See
-# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
-# for a much simpler configuration file.
-#
-# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
-# documentation.
-
-# WARNING: See config/application.rb under "Relative url support" for the list of
-# other files that need to be changed for relative url support
-#
-# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
-
-# Read about unicorn workers here:
-# http://doc.gitlab.com/ee/install/requirements.html#unicorn-workers
-#
-worker_processes 3
-
-# Since Unicorn is never exposed to outside clients, it does not need to
-# run on the standard HTTP port (80), there is no reason to start Unicorn
-# as root unless it's from system init scripts.
-# If running the master process as root and the workers as an unprivileged
-# user, do this to switch euid/egid in the workers (also chowns logs):
-# user "unprivileged_user", "unprivileged_group"
-
-# Help ensure your application will always spawn in the symlinked
-# "current" directory that Capistrano sets up.
-working_directory "/home/git/gitlab" # available in 0.94.0+
-
-# Listen on both a Unix domain socket and a TCP port.
-# If you are load-balancing multiple Unicorn masters, lower the backlog
-# setting to e.g. 64 for faster failover.
-listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
-listen "127.0.0.1:8080", :tcp_nopush => true
-
-# nuke workers after 30 seconds instead of 60 seconds (the default)
-#
-# NOTICE: git push over http depends on this value.
-# If you want be able to push huge amount of data to git repository over http
-# you will have to increase this value too.
-#
-# Example of output if you try to push 1GB repo to GitLab over http.
-# -> git push http://gitlab.... master
-#
-# error: RPC failed; result=18, HTTP code = 200
-# fatal: The remote end hung up unexpectedly
-# fatal: The remote end hung up unexpectedly
-#
-# For more information see http://stackoverflow.com/a/21682112/752049
-#
-timeout 60
-
-# feel free to point this anywhere accessible on the filesystem
-pid "/home/git/gitlab/tmp/pids/unicorn.pid"
-
-# By default, the Unicorn logger will write to stderr.
-# Additionally, some applications/frameworks log to stderr or stdout,
-# so prevent them from going to /dev/null when daemonized here:
-stderr_path "/home/git/gitlab/log/unicorn.stderr.log"
-stdout_path "/home/git/gitlab/log/unicorn.stdout.log"
-
-# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings
-# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
-preload_app true
-GC.respond_to?(:copy_on_write_friendly=) and
- GC.copy_on_write_friendly = true
-
-# Enable this flag to have unicorn test client connections by writing the
-# beginning of the HTTP headers before calling the application. This
-# prevents calling the application for connections that have disconnected
-# while queued. This is only guaranteed to detect clients on the same
-# host unicorn runs on, and unlikely to detect disconnects even on a
-# fast LAN.
-check_client_connection false
-
-before_fork do |server, worker|
- # the following is highly recomended for Rails + "preload_app true"
- # as there's no need for the master process to hold a connection
- defined?(ActiveRecord::Base) and
- ActiveRecord::Base.connection.disconnect!
-
- # The following is only recommended for memory/DB-constrained
- # installations. It is not needed if your system can house
- # twice as many worker_processes as you have configured.
- #
- # This allows a new master process to incrementally
- # phase out the old master process with SIGTTOU to avoid a
- # thundering herd (especially in the "preload_app false" case)
- # when doing a transparent upgrade. The last worker spawned
- # will then kill off the old master process with a SIGQUIT.
- old_pid = "#{server.config[:pid]}.oldbin"
- if old_pid != server.pid
- begin
- sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
- Process.kill(sig, File.read(old_pid).to_i)
- rescue Errno::ENOENT, Errno::ESRCH
- end
- end
- #
- # Throttle the master from forking too quickly by sleeping. Due
- # to the implementation of standard Unix signal handlers, this
- # helps (but does not completely) prevent identical, repeated signals
- # from being lost when the receiving process is busy.
- # sleep 1
-end
-
-after_fork do |server, worker|
- # per-process listener ports for debugging/admin/migrations
- # addr = "127.0.0.1:#{9293 + worker.nr}"
- # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
-
- # the following is *required* for Rails + "preload_app true",
- defined?(ActiveRecord::Base) and
- ActiveRecord::Base.establish_connection
-
- # if preload_app is true, then you may also want to check and
- # restart any other shared sockets/descriptors such as Memcached,
- # and Redis. TokyoCabinet file handles are safe to reuse
- # between any number of forked children (assuming your kernel
- # correctly implements pread()/pwrite() system calls)
-end
diff --git a/config/unicorn.rb.example.development b/config/unicorn.rb.example.development
deleted file mode 100644
index 3cd00d53a151e35a8711378c657b66764b8be1ca..0000000000000000000000000000000000000000
--- a/config/unicorn.rb.example.development
+++ /dev/null
@@ -1,2 +0,0 @@
-worker_processes 2
-timeout 60
diff --git a/db/fixtures/development/01_admin.rb b/db/fixtures/development/01_admin.rb
deleted file mode 100644
index bba2fc4b186ea050f64b106928d22db3011d38ef..0000000000000000000000000000000000000000
--- a/db/fixtures/development/01_admin.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-Gitlab::Seeder.quiet do
- User.seed do |s|
- s.id = 1
- s.name = 'Administrator'
- s.email = 'admin@example.com'
- s.notification_email = 'admin@example.com'
- s.username = 'root'
- s.password = '5iveL!fe'
- s.admin = true
- s.projects_limit = 100
- s.confirmed_at = DateTime.now
- end
-end
diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb
deleted file mode 100644
index ae4c0550a4f8fcfc4d022b5d9fcb1248417295e3..0000000000000000000000000000000000000000
--- a/db/fixtures/development/04_project.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'sidekiq/testing'
-
-Sidekiq::Testing.inline! do
- Gitlab::Seeder.quiet do
- project_urls = [
- 'https://github.com/documentcloud/underscore.git',
- 'https://gitlab.com/gitlab-org/gitlab-ce.git',
- 'https://gitlab.com/gitlab-org/gitlab-ci.git',
- 'https://gitlab.com/gitlab-org/gitlab-shell.git',
- 'https://gitlab.com/gitlab-org/gitlab-test.git',
- 'https://github.com/twitter/flight.git',
- 'https://github.com/twitter/typeahead.js.git',
- 'https://github.com/h5bp/html5-boilerplate.git',
- ]
-
- project_urls.each_with_index do |url, i|
- group_path, project_path = url.split('/')[-2..-1]
-
- group = Group.find_by(path: group_path)
-
- unless group
- group = Group.new(
- name: group_path.titleize,
- path: group_path
- )
- group.description = Faker::Lorem.sentence
- group.save
-
- group.add_owner(User.first)
- end
-
- project_path.gsub!(".git", "")
-
- params = {
- import_url: url,
- namespace_id: group.id,
- name: project_path.titleize,
- description: Faker::Lorem.sentence,
- visibility_level: Gitlab::VisibilityLevel.values.sample
- }
-
- project = Projects::CreateService.new(User.first, params).execute
-
- if project.valid?
- print '.'
- else
- puts project.errors.full_messages
- print 'F'
- end
- end
- end
-end
diff --git a/db/fixtures/development/05_users.rb b/db/fixtures/development/05_users.rb
deleted file mode 100644
index 24952a1f66167a2d324380de6791c34b9399535f..0000000000000000000000000000000000000000
--- a/db/fixtures/development/05_users.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-Gitlab::Seeder.quiet do
- (2..20).each do |i|
- begin
- User.create!(
- username: Faker::Internet.user_name,
- name: Faker::Name.name,
- email: Faker::Internet.email,
- confirmed_at: DateTime.now,
- password: '12345678'
- )
-
- print '.'
- rescue ActiveRecord::RecordInvalid
- print 'F'
- end
- end
-
- (1..5).each do |i|
- begin
- User.create!(
- username: "user#{i}",
- name: "User #{i}",
- email: "user#{i}@example.com",
- confirmed_at: DateTime.now,
- password: '12345678'
- )
- print '.'
- rescue ActiveRecord::RecordInvalid
- print 'F'
- end
- end
-end
diff --git a/db/fixtures/development/06_teams.rb b/db/fixtures/development/06_teams.rb
deleted file mode 100644
index 3e8cdcd67b4a66ab88eb6927453d98782b85bfa2..0000000000000000000000000000000000000000
--- a/db/fixtures/development/06_teams.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-Gitlab::Seeder.quiet do
- Group.all.each do |group|
- User.all.sample(4).each do |user|
- if group.add_users([user.id], Gitlab::Access.values.sample)
- print '.'
- else
- print 'F'
- end
- end
- end
-
- Project.all.each do |project|
- User.all.sample(4).each do |user|
- if project.team << [user, Gitlab::Access.values.sample]
- print '.'
- else
- print 'F'
- end
- end
- end
-end
diff --git a/db/fixtures/development/07_milestones.rb b/db/fixtures/development/07_milestones.rb
deleted file mode 100644
index 2296821e528b7d2f3672e9ecaebfcc66589cc838..0000000000000000000000000000000000000000
--- a/db/fixtures/development/07_milestones.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-Gitlab::Seeder.quiet do
- Project.all.each do |project|
- (1..5).each do |i|
- milestone_params = {
- title: "v#{i}.0",
- description: Faker::Lorem.sentence,
- state: ['opened', 'closed'].sample,
- }
-
- milestone = Milestones::CreateService.new(
- project, project.team.users.sample, milestone_params).execute
-
- print '.'
- end
- end
-end
diff --git a/db/fixtures/development/09_issues.rb b/db/fixtures/development/09_issues.rb
deleted file mode 100644
index e8b01b46d22138dd9a75b1d07f22a151dd1b5840..0000000000000000000000000000000000000000
--- a/db/fixtures/development/09_issues.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-Gitlab::Seeder.quiet do
- Project.all.each do |project|
- (1..10).each do |i|
- issue_params = {
- title: Faker::Lorem.sentence(6),
- description: Faker::Lorem.sentence,
- state: ['opened', 'closed'].sample,
- milestone: project.milestones.sample,
- assignee: project.team.users.sample
- }
-
- Issues::CreateService.new(project, project.team.users.sample, issue_params).execute
- print '.'
- end
- end
-end
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb
deleted file mode 100644
index f9b2fd8b05fd044e95bcb381b258562206132821..0000000000000000000000000000000000000000
--- a/db/fixtures/development/10_merge_requests.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-Gitlab::Seeder.quiet do
- Project.all.reject(&:empty_repo?).each do |project|
- branches = project.repository.branch_names
-
- branches.each do |branch_name|
- break if branches.size < 2
- source_branch = branches.pop
- target_branch = branches.pop
-
- params = {
- source_branch: source_branch,
- target_branch: target_branch,
- title: Faker::Lorem.sentence(6),
- description: Faker::Lorem.sentences(3).join(" "),
- milestone: project.milestones.sample,
- assignee: project.team.users.sample
- }
-
- MergeRequests::CreateService.new(project, project.team.users.sample, params).execute
- print '.'
- end
- end
-
- project = Project.find_with_namespace('gitlab-org/gitlab-test')
-
- params = {
- source_branch: 'feature',
- target_branch: 'master',
- title: 'Can be automatically merged'
- }
- MergeRequests::CreateService.new(project, User.admins.first, params).execute
- print '.'
-
- params = {
- source_branch: 'feature_conflict',
- target_branch: 'feature',
- title: 'Cannot be automatically merged'
- }
- MergeRequests::CreateService.new(project, User.admins.first, params).execute
- print '.'
-end
diff --git a/db/fixtures/development/11_keys.rb b/db/fixtures/development/11_keys.rb
deleted file mode 100644
index 8b4bee384e1551dda3e98511ecb0a48612a71b25..0000000000000000000000000000000000000000
--- a/db/fixtures/development/11_keys.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-Gitlab::Seeder.quiet do
- User.first(10).each do |user|
- key = "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt#{user.id + 100}6k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
-
- user.keys.create(
- title: "Sample key #{user.id}",
- key: key
- )
-
- print '.'
- end
-end
diff --git a/db/fixtures/development/12_snippets.rb b/db/fixtures/development/12_snippets.rb
deleted file mode 100644
index b3a6f39c7d5d0e1890629bca0243ded24d64f02c..0000000000000000000000000000000000000000
--- a/db/fixtures/development/12_snippets.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-Gitlab::Seeder.quiet do
- content =<```, or are indented with four spaces. Only the fenced code blocks support syntax highlighting.
-
-```no-highlight
-Inline `code` has `back-ticks around` it.
-```
-
-Inline `code` has `back-ticks around` it.
-
-Example:
-
- ```javascript
- var s = "JavaScript syntax highlighting";
- alert(s);
- ```
-
- ```python
- def function():
- #indenting works just fine in the fenced code block
- s = "Python syntax highlighting"
- print s
- ```
-
- ```ruby
- require 'redcarpet'
- markdown = Redcarpet.new("Hello World!")
- puts markdown.to_html
- ```
-
- ```
- No language indicated, so no syntax highlighting.
- s = "There is no highlighting for this."
- But let's throw in a tag.
- ```
-
-becomes:
-
-```javascript
-var s = "JavaScript syntax highlighting";
-alert(s);
-```
-
-```python
-def function():
- #indenting works just fine in the fenced code block
- s = "Python syntax highlighting"
- print s
-```
-
-```ruby
-require 'redcarpet'
-markdown = Redcarpet.new("Hello World!")
-puts markdown.to_html
-```
-
-```
-No language indicated, so no syntax highlighting.
-s = "There is no highlighting for this."
-But let's throw in a tag.
-```
-
-## Emoji
-
- Sometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you:
-
- :zap: You can use emoji anywhere GFM is supported. :v:
-
- You can use it to point out a :bug: or warn about :speak_no_evil: patches. And if someone improves your really :snail: code, send them some :birthday:. People will :heart: you for that.
-
- If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes.
-
- Consult the [Emoji Cheat Sheet](http://emoji.codes) for a list of all supported emoji codes. :thumbsup:
-
-Sometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you:
-
-:zap: You can use emoji anywhere GFM is supported. :v:
-
-You can use it to point out a :bug: or warn about :speak_no_evil: patches. And if someone improves your really :snail: code, send them some :birthday:. People will :heart: you for that.
-
-If you are new to this, don't be :fearful:. You can easily join the emoji :family:. All you need to do is to look up on the supported codes.
-
-Consult the [Emoji Cheat Sheet](http://emoji.codes) for a list of all supported emoji codes. :thumbsup:
-
-## Special GitLab References
-
-GFM recognized special references.
-
-You can easily reference e.g. an issue, a commit, a team member or even the whole team within a project.
-
-GFM will turn that reference into a link so you can navigate between them easily.
-
-GFM will recognize the following:
-
-- @foo : for specific team members or groups
-- @all : for the whole team
-- #123 : for issues
-- !123 : for merge requests
-- $123 : for snippets
-- 1234567 : for commits
-- \[file\](path/to/file) : for file references
-
-GFM also recognizes references to commits, issues, and merge requests in other projects:
-
-- namespace/project#123 : for issues
-- namespace/project!123 : for merge requests
-- namespace/project@1234567 : for commits
-
-## Task Lists
-
-You can add task lists to merge request and issue descriptions to keep track of to-do items. To create a task, add an unordered list to the description in an issue or merge request, formatted like so:
-
-```no-highlight
-* [x] Completed task
-* [ ] Unfinished task
- * [x] Nested task
-```
-
-Task lists can only be created in descriptions, not in titles or comments. Task item state can be managed by editing the description's Markdown or by clicking the rendered checkboxes.
-
-# Standard Markdown
-
-## Headers
-
-```no-highlight
-# H1
-## H2
-### H3
-#### H4
-##### H5
-###### H6
-
-Alternatively, for H1 and H2, an underline-ish style:
-
-Alt-H1
-======
-
-Alt-H2
-------
-```
-
-# H1
-## H2
-### H3
-#### H4
-##### H5
-###### H6
-
-Alternatively, for H1 and H2, an underline-ish style:
-
-Alt-H1
-======
-
-Alt-H2
-------
-
-### Header IDs and links
-
-All markdown rendered headers automatically get IDs, except for comments.
-
-On hover a link to those IDs becomes visible to make it easier to copy the link to the header to give it to someone else.
-
-The IDs are generated from the content of the header according to the following rules:
-
-1. remove the heading hashes `#` and process the rest of the line as it would be processed if it were not a header
-2. from the result, remove all HTML tags, but keep their inner content
-3. convert all characters to lowercase
-4. convert all characters except `[a-z0-9_-]` into hyphens `-`
-5. transform multiple adjacent hyphens into a single hyphen
-6. remove trailing and heading hyphens
-
-For example:
-
-```
-###### ..Ab_c-d. e [anchor](URL) ..
-```
-
-which renders as:
-
-###### ..Ab_c-d. e [anchor](URL) ..
-
-will first be converted by step 1) into a string like:
-
-```
-..Ab_c-d. e <a href="URL">anchor</a> <img src="URL" alt="alt text"/>..
-```
-
-After removing the tags in step 2) we get:
-
-```
-..Ab_c-d. e anchor ..
-```
-
-And applying all the other steps gives the id:
-
-```
-ab_c-d-e-anchor
-```
-
-Note in particular how:
-
-- for markdown anchors `[text](URL)`, only the `text` is used
-- markdown images `` are completely ignored
-
-## Emphasis
-
-```no-highlight
-Emphasis, aka italics, with *asterisks* or _underscores_.
-
-Strong emphasis, aka bold, with **asterisks** or __underscores__.
-
-Combined emphasis with **asterisks and _underscores_**.
-
-Strikethrough uses two tildes. ~~Scratch this.~~
-```
-
-Emphasis, aka italics, with *asterisks* or _underscores_.
-
-Strong emphasis, aka bold, with **asterisks** or __underscores__.
-
-Combined emphasis with **asterisks and _underscores_**.
-
-Strikethrough uses two tildes. ~~Scratch this.~~
-
-## Lists
-
-```no-highlight
-1. First ordered list item
-2. Another item
- * Unordered sub-list.
-1. Actual numbers don't matter, just that it's a number
- 1. Ordered sub-list
-4. And another item.
-
- Some text that should be aligned with the above item.
-
-* Unordered list can use asterisks
-- Or minuses
-+ Or pluses
-```
-
-1. First ordered list item
-2. Another item
- * Unordered sub-list.
-1. Actual numbers don't matter, just that it's a number
- 1. Ordered sub-list
-4. And another item.
-
- Some text that should be aligned with the above item.
-
-* Unordered list can use asterisks
-- Or minuses
-+ Or pluses
-
-## Links
-
-There are two ways to create links, inline-style and reference-style.
-
- [I'm an inline-style link](https://www.google.com)
-
- [I'm a reference-style link][Arbitrary case-insensitive reference text]
-
- [I'm a relative reference to a repository file](LICENSE)
-
- [You can use numbers for reference-style link definitions][1]
-
- Or leave it empty and use the [link text itself][]
-
- Some text to show that the reference links can follow later.
-
- [arbitrary case-insensitive reference text]: https://www.mozilla.org
- [1]: http://slashdot.org
- [link text itself]: http://www.reddit.com
-
-[I'm an inline-style link](https://www.google.com)
-
-[I'm a reference-style link][Arbitrary case-insensitive reference text]
-
-[I'm a relative reference to a repository file](LICENSE)
-
-[You can use numbers for reference-style link definitions][1]
-
-Or leave it empty and use the [link text itself][]
-
-Some text to show that the reference links can follow later.
-
-[arbitrary case-insensitive reference text]: https://www.mozilla.org
-[1]: http://slashdot.org
-[link text itself]: http://www.reddit.com
-
-**Note**
-
-Relative links do not allow referencing project files in a wiki page or wiki page in a project file. The reason for this is that, in GitLab, wiki is always a separate git repository. For example:
-
-`[I'm a reference-style link][style]`
-
-will point the link to `wikis/style` when the link is inside of a wiki markdown file.
-
-## Images
-
- Here's our logo (hover to see the title text):
-
- Inline-style:
- 
-
- Reference-style:
- ![alt text1][logo]
-
- [logo]: assets/logo-white.png
-
-Here's our logo:
-
-Inline-style:
-
-
-
-Reference-style:
-
-![alt text][logo]
-
-[logo]: /assets/logo-white.png
-
-## Blockquotes
-
-```no-highlight
-> Blockquotes are very handy in email to emulate reply text.
-> This line is part of the same quote.
-
-Quote break.
-
-> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
-```
-
-> Blockquotes are very handy in email to emulate reply text.
-> This line is part of the same quote.
-
-Quote break.
-
-> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
-
-## Inline HTML
-
-You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
-
-See the documentation for HTML::Pipeline's [SanitizationFilter](http://www.rubydoc.info/gems/html-pipeline/HTML/Pipeline/SanitizationFilter#WHITELIST-constant) class for the list of allowed HTML tags and attributes. In addition to the default `SanitizationFilter` whitelist, GitLab allows the `class`, `id`, and `style` attributes.
-
-```no-highlight
-
-
-```
-
-
-
-
-## Horizontal Rule
-
-```
-Three or more...
-
----
-
-Hyphens
-
-***
-
-Asterisks
-
-___
-
-Underscores
-```
-
-Three or more...
-
----
-
-Hyphens
-
-***
-
-Asterisks
-
-___
-
-Underscores
-
-## Line Breaks
-
-My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You'll soon learn to get what you want. "Markdown Toggle" is your friend.
-
-Here are some things to try out:
-
-```
-Here's a line for us to start with.
-
-This line is separated from the one above by two newlines, so it will be a *separate paragraph*.
-
-This line is also a separate paragraph, but...
-This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
-
-This line is also a separate paragraph, and...
-This line is on its own line, because the previous line ends with two
-spaces.
-```
-
-Here's a line for us to start with.
-
-This line is separated from the one above by two newlines, so it will be a *separate paragraph*.
-
-This line is also begins a separate paragraph, but...
-This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
-
-This line is also a separate paragraph, and...
-This line is on its own line, because the previous line ends with two
-spaces.
-
-## Tables
-
-Tables aren't part of the core Markdown spec, but they are part of GFM and Markdown Here supports them.
-
-```
-| header 1 | header 2 |
-| -------- | -------- |
-| cell 1 | cell 2 |
-| cell 3 | cell 4 |
-```
-
-Code above produces next output:
-
-| header 1 | header 2 |
-| -------- | -------- |
-| cell 1 | cell 2 |
-| cell 3 | cell 4 |
-
-**Note**
-
-The row of dashes between the table header and body must have at least three dashes in each column.
-
-## References
-
-- This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
-- The [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) at Daring Fireball is an excellent resource for a detailed explanation of standard markdown.
-- [Dillinger.io](http://dillinger.io) is a handy tool for testing standard markdown.
diff --git a/doc/operations/README.md b/doc/operations/README.md
deleted file mode 100644
index f1456c6c8e2abae2faf7076078e8157a96b71765..0000000000000000000000000000000000000000
--- a/doc/operations/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# GitLab operations
-
-- [Sidekiq MemoryKiller](sidekiq_memory_killer.md)
-- [Cleaning up Redis sessions](cleaning_up_redis_sessions.md)
diff --git a/doc/operations/cleaning_up_redis_sessions.md b/doc/operations/cleaning_up_redis_sessions.md
deleted file mode 100644
index 93521e976d51e05204c34addbedc8cb0e4c514ab..0000000000000000000000000000000000000000
--- a/doc/operations/cleaning_up_redis_sessions.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# Cleaning up stale Redis sessions
-
-Since version 6.2, GitLab stores web user sessions as key-value pairs in Redis.
-Prior to GitLab 7.3, user sessions did not automatically expire from Redis. If
-you have been running a large GitLab server (thousands of users) since before
-GitLab 7.3 we recommend cleaning up stale sessions to compact the Redis
-database after you upgrade to GitLab 7.3. You can also perform a cleanup while
-still running GitLab 7.2 or older, but in that case new stale sessions will
-start building up again after you clean up.
-
-In GitLab versions prior to 7.3.0, the session keys in Redis are 16-byte
-hexadecimal values such as '976aa289e2189b17d7ef525a6702ace9'. Starting with
-GitLab 7.3.0, the keys are
-prefixed with 'session:gitlab:', so they would look like
-'session:gitlab:976aa289e2189b17d7ef525a6702ace9'. Below we describe how to
-remove the keys in the old format.
-
-First we define a shell function with the proper Redis connection details.
-
-```
-rcli() {
- # This example works for Omnibus installations of GitLab 7.3 or newer. For an
- # installation from source you will have to change the socket path and the
- # path to redis-cli.
- sudo /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket "$@"
-}
-
-# test the new shell function; the response should be PONG
-rcli ping
-```
-
-Now we do a search to see if there are any session keys in the old format for
-us to clean up.
-
-```
-# returns the number of old-format session keys in Redis
-rcli keys '*' | grep '^[a-f0-9]\{32\}$' | wc -l
-```
-
-If the number is larger than zero, you can proceed to expire the keys from
-Redis. If the number is zero there is nothing to clean up.
-
-```
-# Tell Redis to expire each matched key after 600 seconds.
-rcli keys '*' | grep '^[a-f0-9]\{32\}$' | awk '{ print "expire", $0, 600 }' | rcli
-# This will print '(integer) 1' for each key that gets expired.
-```
-
-Over the next 15 minutes (10 minutes expiry time plus 5 minutes Redis
-background save interval) your Redis database will be compacted. If you are
-still using GitLab 7.2, users who are not clicking around in GitLab during the
-10 minute expiry window will be signed out of GitLab.
diff --git a/doc/operations/sidekiq_memory_killer.md b/doc/operations/sidekiq_memory_killer.md
deleted file mode 100644
index 867b01b0d5ae746e2e3e459296ace116a9795f95..0000000000000000000000000000000000000000
--- a/doc/operations/sidekiq_memory_killer.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Sidekiq MemoryKiller
-
-The GitLab Rails application code suffers from memory leaks. For web requests
-this problem is made manageable using
-[unicorn-worker-killer](https://github.com/kzk/unicorn-worker-killer) which
-restarts Unicorn worker processes in between requests when needed. The Sidekiq
-MemoryKiller applies the same approach to the Sidekiq processes used by GitLab
-to process background jobs.
-
-Unlike unicorn-worker-killer, which is enabled by default for all GitLab
-installations since GitLab 6.4, the Sidekiq MemoryKiller is enabled by default
-_only_ for Omnibus packages. The reason for this is that the MemoryKiller
-relies on Runit to restart Sidekiq after a memory-induced shutdown and GitLab
-installations from source do not all use Runit or an equivalent.
-
-With the default settings, the MemoryKiller will cause a Sidekiq restart no
-more often than once every 15 minutes, with the restart causing about one
-minute of delay for incoming background jobs.
-
-## Configuring the MemoryKiller
-
-The MemoryKiller is controlled using environment variables.
-
-- `SIDEKIQ_MEMORY_KILLER_MAX_RSS`: if this variable is set, and its value is
- greater than 0, then after each Sidekiq job, the MemoryKiller will check the
- RSS of the Sidekiq process that executed the job. If the RSS of the Sidekiq
- process (expressed in kilobytes) exceeds SIDEKIQ_MEMORY_KILLER_MAX_RSS, a
- delayed shutdown is triggered. The default value for Omnibus packages is set
- [in the omnibus-gitlab
- repository](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/attributes/default.rb).
-- `SIDEKIQ_MEMORY_KILLER_GRACE_TIME`: defaults 900 seconds (15 minutes). When
- a shutdown is triggered, the Sidekiq process will keep working normally for
- another 15 minutes.
-- `SIDEKIQ_MEMORY_KILLER_SHUTDOWN_WAIT`: defaults to 30 seconds. When the grace
- time has expired, the MemoryKiller tells Sidekiq to stop accepting new jobs.
- Existing jobs get 30 seconds to finish. After that, the MemoryKiller tells
- Sidekiq to shut down, and an external supervision mechanism (e.g. Runit) must
- restart Sidekiq.
diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md
deleted file mode 100644
index 8cfa7f9c876f35bd3c739dc9d518a2ad05ae42b1..0000000000000000000000000000000000000000
--- a/doc/permissions/permissions.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# Permissions
-
-Users have different abilities depending on the access level they have in a particular group or project.
-
-If a user is both in a project group and in the project itself, the highest permission level is used.
-
-If a user is a GitLab administrator they receive all permissions.
-
-## Project
-
-| Action | Guest | Reporter | Developer | Master | Owner |
-|---------------------------------------|---------|------------|-------------|----------|--------|
-| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
-| Leave comments | ✓ | ✓ | ✓ | ✓ | ✓ |
-| Pull project code | | ✓ | ✓ | ✓ | ✓ |
-| Download project | | ✓ | ✓ | ✓ | ✓ |
-| Create code snippets | | ✓ | ✓ | ✓ | ✓ |
-| Create new merge request | | | ✓ | ✓ | ✓ |
-| Create new branches | | | ✓ | ✓ | ✓ |
-| Push to non-protected branches | | | ✓ | ✓ | ✓ |
-| Force push to non-protected branches | | | ✓ | ✓ | ✓ |
-| Remove non-protected branches | | | ✓ | ✓ | ✓ |
-| Add tags | | | ✓ | ✓ | ✓ |
-| Write a wiki | | | ✓ | ✓ | ✓ |
-| Manage issue tracker | | | ✓ | ✓ | ✓ |
-| Manage labels | | | ✓ | ✓ | ✓ |
-| Create new milestones | | | | ✓ | ✓ |
-| Add new team members | | | | ✓ | ✓ |
-| Push to protected branches | | | | ✓ | ✓ |
-| Enable/disable branch protection | | | | ✓ | ✓ |
-| Turn on/off prot. branch push for devs| | | | ✓ | ✓ |
-| Rewrite/remove git tags | | | | ✓ | ✓ |
-| Edit project | | | | ✓ | ✓ |
-| Add deploy keys to project | | | | ✓ | ✓ |
-| Configure project hooks | | | | ✓ | ✓ |
-| Switch visibility level | | | | | ✓ |
-| Transfer project to another namespace | | | | | ✓ |
-| Remove project | | | | | ✓ |
-| Force push to protected branches | | | | | |
-| Remove protected branches | | | | | |
-
-## Group
-
-In order for a group to appear as public and be browsable, it must contain at
-least one public project.
-
-Any user can remove themselves from a group, unless they are the last Owner of the group.
-
-| Action | Guest | Reporter | Developer | Master | Owner |
-|-------------------------|-------|----------|-----------|--------|-------|
-| Browse group | ✓ | ✓ | ✓ | ✓ | ✓ |
-| Edit group | | | | | ✓ |
-| Create project in group | | | | ✓ | ✓ |
-| Manage group members | | | | | ✓ |
-| Remove group | | | | | ✓ |
diff --git a/doc/project_services/bamboo.md b/doc/project_services/bamboo.md
deleted file mode 100644
index 51668128c6245cf8222875a15cc2bb8084460ded..0000000000000000000000000000000000000000
--- a/doc/project_services/bamboo.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# Atlassian Bamboo CI Service
-
-GitLab provides integration with Atlassian Bamboo for continuous integration.
-When configured, pushes to a project will trigger a build in Bamboo automatically.
-Merge requests will also display CI status showing whether the build is pending,
-failed, or completed successfully. It also provides a link to the Bamboo build
-page for more information.
-
-Bamboo doesn't quite provide the same features as a traditional build system when
-it comes to accepting webhooks and commit data. There are a few things that
-need to be configured in a Bamboo build plan before GitLab can integrate.
-
-## Setup
-
-### Complete these steps in Bamboo:
-
-1. Navigate to a Bamboo build plan and choose 'Configure plan' from the 'Actions'
-dropdown.
-1. Select the 'Triggers' tab.
-1. Click 'Add trigger'.
-1. Enter a description such as 'GitLab trigger'
-1. Choose 'Repository triggers the build when changes are committed'
-1. Check one or more repositories checkboxes
-1. Enter the GitLab IP address in the 'Trigger IP addresses' box. This is a
-whitelist of IP addresses that are allowed to trigger Bamboo builds.
-1. Save the trigger.
-1. In the left pane, select a build stage. If you have multiple build stages
-you want to select the last stage that contains the git checkout task.
-1. Select the 'Miscellaneous' tab.
-1. Under 'Pattern Match Labelling' put '${bamboo.repository.revision.number}'
-in the 'Labels' box.
-1. Save
-
-Bamboo is now ready to accept triggers from GitLab. Next, set up the Bamboo
-service in GitLab
-
-### Complete these steps in GitLab:
-
-1. Navigate to the project you want to configure to trigger builds.
-1. Select 'Settings' in the top navigation.
-1. Select 'Services' in the left navigation.
-1. Click 'Atlassian Bamboo CI'
-1. Select the 'Active' checkbox.
-1. Enter the base URL of your Bamboo server. 'https://bamboo.example.com'
-1. Enter the build key from your Bamboo build plan. Build keys are a short,
-all capital letter, identifier that is unique. It will be something like PR-BLD
-1. If necessary, enter username and password for a Bamboo user that has
-access to trigger the build plan. Leave these fields blank if you do not require
-authentication.
-1. Save or optionally click 'Test Settings'. Please note that 'Test Settings'
-will actually trigger a build in Bamboo.
-
-## Troubleshooting
-
-If builds are not triggered, these are a couple of things to keep in mind.
-
-1. Ensure you entered the right GitLab IP address in Bamboo under 'Trigger
-IP addresses'.
-1. Remember that GitLab only triggers builds on push events. A commit via the
-web interface will not trigger CI currently.
diff --git a/doc/project_services/hipchat.md b/doc/project_services/hipchat.md
deleted file mode 100644
index 021a93a288ff9de25dac5cda9cca1cef36a93795..0000000000000000000000000000000000000000
--- a/doc/project_services/hipchat.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# Atlassian HipChat
-
-GitLab provides a way to send HipChat notifications upon a number of events,
-such as when a user pushes code, creates a branch or tag, adds a comment, and
-creates a merge request.
-
-## Setup
-
-GitLab requires the use of a HipChat v2 API token to work. v1 tokens are
-not supported at this time. Note the differences between v1 and v2 tokens:
-
-HipChat v1 API (legacy) supports "API Auth Tokens" in the Group API menu. A v1
-token is allowed to send messages to *any* room.
-
-HipChat v2 API has tokens that are can be created using the Integrations tab
-in the Group or Room admin page. By design, these are lightweight tokens that
-allow GitLab to send messages only to *one* room.
-
-### Complete these steps in HipChat:
-
-1. Go to: https://admin.hipchat.com/admin
-1. Click on "Group Admin" -> "Integrations".
-1. Find "Build Your Own!" and click "Create".
-1. Select the desired room, name the integration "GitLab", and click "Create".
-1. In the "Send messages to this room by posting this URL" column, you should
-see a URL in the format:
-
-```
- https://api.hipchat.com/v2/room/.*?
|.*?}m) { |match| '' }
- text.gsub!(%r{^```.*?^```}m) { |match| '' }
-
- @references = Hash.new { |hash, type| hash[type] = [] }
- parse_references(text)
- end
-
- # Given a valid project, resolve the extracted identifiers of the requested type to
- # model objects.
-
- def users
- references[:user].uniq.map do |project, identifier|
- if identifier == "all"
- project.team.members.flatten
- elsif namespace = Namespace.find_by(path: identifier)
- if namespace.is_a?(Group)
- namespace.users
- else
- namespace.owner
- end
- end
- end.flatten.compact.uniq
- end
-
- def labels
- references[:label].uniq.map do |project, identifier|
- project.labels.where(id: identifier).first
- end.compact.uniq
- end
-
- def issues
- references[:issue].uniq.map do |project, identifier|
- if project.default_issues_tracker?
- project.issues.where(iid: identifier).first
- end
- end.compact.uniq
- end
-
- def merge_requests
- references[:merge_request].uniq.map do |project, identifier|
- project.merge_requests.where(iid: identifier).first
- end.compact.uniq
- end
-
- def snippets
- references[:snippet].uniq.map do |project, identifier|
- project.snippets.where(id: identifier).first
- end.compact.uniq
- end
-
- def commits
- references[:commit].uniq.map do |project, identifier|
- repo = project.repository
- repo.commit(identifier) if repo
- end.compact.uniq
- end
-
- def commit_ranges
- references[:commit_range].uniq.map do |project, identifier|
- repo = project.repository
- if repo
- from_id, to_id = identifier.split(/\.{2,3}/, 2)
- [repo.commit(from_id), repo.commit(to_id)]
- end
- end.compact.uniq
- end
-
- private
-
- def reference_link(type, identifier, project, _)
- references[type] << [project, identifier]
- end
- end
-end
diff --git a/lib/gitlab/satellite/action.rb b/lib/gitlab/satellite/action.rb
deleted file mode 100644
index 4890ccf21e6338672f4e397427eda69e7e3fd87a..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/action.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-module Gitlab
- module Satellite
- class Action
- DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds }
-
- attr_accessor :options, :project, :user
-
- def initialize(user, project, options = {})
- @options = DEFAULT_OPTIONS.merge(options)
- @project = project
- @user = user
- end
-
- protected
-
- # * Sets a 30s timeout for Git
- # * Locks the satellite repo
- # * Yields the prepared satellite repo
- def in_locked_and_timed_satellite
- Gitlab::ShellEnv.set_env(user)
-
- Grit::Git.with_timeout(options[:git_timeout]) do
- project.satellite.lock do
- return yield project.satellite.repo
- end
- end
- rescue Errno::ENOMEM => ex
- return handle_exception(ex)
- rescue Grit::Git::GitTimeout => ex
- return handle_exception(ex)
- ensure
- Gitlab::ShellEnv.reset_env
- end
-
- # * Recreates the satellite
- # * Sets up Git variables for the user
- #
- # Note: use this within #in_locked_and_timed_satellite
- def prepare_satellite!(repo)
- project.satellite.clear_and_update!
-
- repo.config['user.name'] = user.name
- repo.config['user.email'] = user.email
- end
-
- def default_options(options = {})
- { raise: true, timeout: true }.merge(options)
- end
-
- def handle_exception(exception)
- Gitlab::GitLogger.error(exception.message)
- false
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/compare_action.rb b/lib/gitlab/satellite/compare_action.rb
deleted file mode 100644
index 46c98a8f4cab479a6bfa2f5ee6483864403fd807..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/compare_action.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-module Gitlab
- module Satellite
- class BranchesWithoutParent < StandardError; end
-
- class CompareAction < Action
- def initialize(user, target_project, target_branch, source_project, source_branch)
- super user, target_project
-
- @target_project, @target_branch = target_project, target_branch
- @source_project, @source_branch = source_project, source_branch
- end
-
- # Compare 2 repositories and return Gitlab::CompareResult object
- def result
- in_locked_and_timed_satellite do |target_repo|
- prepare_satellite!(target_repo)
- update_satellite_source_and_target!(target_repo)
-
- Gitlab::CompareResult.new(compare(target_repo))
- end
- rescue Grit::Git::CommandFailed => ex
- raise BranchesWithoutParent
- end
-
- private
-
- # Assumes a satellite exists that is a fresh clone of the projects repo, prepares satellite for diffs
- def update_satellite_source_and_target!(target_repo)
- target_repo.remote_add('source', @source_project.repository.path_to_repo)
- target_repo.remote_fetch('source')
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- def compare(repo)
- @compare ||= Gitlab::Git::Compare.new(
- Gitlab::Git::Repository.new(repo.path),
- "origin/#{@target_branch}",
- "source/#{@source_branch}"
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/files/delete_file_action.rb b/lib/gitlab/satellite/files/delete_file_action.rb
deleted file mode 100644
index 0d37b9dea8502e765aed57cfedfea514f29dcc9e..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/files/delete_file_action.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require_relative 'file_action'
-
-module Gitlab
- module Satellite
- class DeleteFileAction < FileAction
- # Deletes file and creates a new commit for it
- #
- # Returns false if committing the change fails
- # Returns false if pushing from the satellite to bare repo failed or was rejected
- # Returns true otherwise
- def commit!(content, commit_message)
- in_locked_and_timed_satellite do |repo|
- prepare_satellite!(repo)
-
- # create target branch in satellite at the corresponding commit from bare repo
- repo.git.checkout({ raise: true, timeout: true, b: true }, ref, "origin/#{ref}")
-
- # update the file in the satellite's working dir
- file_path_in_satellite = File.join(repo.working_dir, file_path)
-
- # Prevent relative links
- unless safe_path?(file_path_in_satellite)
- Gitlab::GitLogger.error("FileAction: Relative path not allowed")
- return false
- end
-
- File.delete(file_path_in_satellite)
-
- # add removed file
- repo.remove(file_path_in_satellite)
-
- # commit the changes
- # will raise CommandFailed when commit fails
- repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
-
-
- # push commit back to bare repo
- # will raise CommandFailed when push fails
- repo.git.push({ raise: true, timeout: true }, :origin, ref)
-
- # everything worked
- true
- end
- rescue Grit::Git::CommandFailed => ex
- Gitlab::GitLogger.error(ex.message)
- false
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/files/edit_file_action.rb b/lib/gitlab/satellite/files/edit_file_action.rb
deleted file mode 100644
index 3cb9c0b5ecbceed9529812162d235befca60ffb7..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/files/edit_file_action.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require_relative 'file_action'
-
-module Gitlab
- module Satellite
- # GitLab server-side file update and commit
- class EditFileAction < FileAction
- # Updates the files content and creates a new commit for it
- #
- # Returns false if the ref has been updated while editing the file
- # Returns false if committing the change fails
- # Returns false if pushing from the satellite to bare repo failed or was rejected
- # Returns true otherwise
- def commit!(content, commit_message, encoding, new_branch = nil)
- in_locked_and_timed_satellite do |repo|
- prepare_satellite!(repo)
-
- # create target branch in satellite at the corresponding commit from bare repo
- begin
- repo.git.checkout({ raise: true, timeout: true, b: true }, ref, "origin/#{ref}")
- rescue Grit::Git::CommandFailed => ex
- log_and_raise(CheckoutFailed, ex.message)
- end
-
- # update the file in the satellite's working dir
- file_path_in_satellite = File.join(repo.working_dir, file_path)
-
- # Prevent relative links
- unless safe_path?(file_path_in_satellite)
- Gitlab::GitLogger.error("FileAction: Relative path not allowed")
- return false
- end
-
- # Write file
- write_file(file_path_in_satellite, content, encoding)
-
- # commit the changes
- # will raise CommandFailed when commit fails
- begin
- repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
- rescue Grit::Git::CommandFailed => ex
- log_and_raise(CommitFailed, ex.message)
- end
-
-
- target_branch = new_branch.present? ? "#{ref}:#{new_branch}" : ref
-
- # push commit back to bare repo
- # will raise CommandFailed when push fails
- begin
- repo.git.push({ raise: true, timeout: true }, :origin, target_branch)
- rescue Grit::Git::CommandFailed => ex
- log_and_raise(PushFailed, ex.message)
- end
-
- # everything worked
- true
- end
- end
-
- private
-
- def log_and_raise(errorClass, message)
- Gitlab::GitLogger.error(message)
- raise(errorClass, message)
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/files/file_action.rb b/lib/gitlab/satellite/files/file_action.rb
deleted file mode 100644
index 6446b14568a5de087d3e0cbbf91506dacf24fa74..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/files/file_action.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module Gitlab
- module Satellite
- class FileAction < Action
- attr_accessor :file_path, :ref
-
- def initialize(user, project, ref, file_path)
- super user, project
- @file_path = file_path
- @ref = ref
- end
-
- def safe_path?(path)
- File.absolute_path(path) == path
- end
-
- def write_file(abs_file_path, content, file_encoding = 'text')
- if file_encoding == 'base64'
- File.open(abs_file_path, 'wb') { |f| f.write(Base64.decode64(content)) }
- else
- File.open(abs_file_path, 'w') { |f| f.write(content) }
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/files/new_file_action.rb b/lib/gitlab/satellite/files/new_file_action.rb
deleted file mode 100644
index 724dfa0d042e1a80376a40dad4a34967998fdf5e..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/files/new_file_action.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require_relative 'file_action'
-
-module Gitlab
- module Satellite
- class NewFileAction < FileAction
- # Updates the files content and creates a new commit for it
- #
- # Returns false if the ref has been updated while editing the file
- # Returns false if committing the change fails
- # Returns false if pushing from the satellite to bare repo failed or was rejected
- # Returns true otherwise
- def commit!(content, commit_message, encoding, new_branch = nil)
- in_locked_and_timed_satellite do |repo|
- prepare_satellite!(repo)
-
- # create target branch in satellite at the corresponding commit from bare repo
- current_ref =
- if @project.empty_repo?
- # skip this step if we want to add first file to empty repo
- Satellite::PARKING_BRANCH
- else
- repo.git.checkout({ raise: true, timeout: true, b: true }, ref, "origin/#{ref}")
- ref
- end
-
- file_path_in_satellite = File.join(repo.working_dir, file_path)
- dir_name_in_satellite = File.dirname(file_path_in_satellite)
-
- # Prevent relative links
- unless safe_path?(file_path_in_satellite)
- Gitlab::GitLogger.error("FileAction: Relative path not allowed")
- return false
- end
-
- # Create dir if not exists
- FileUtils.mkdir_p(dir_name_in_satellite)
-
- # Write file
- write_file(file_path_in_satellite, content, encoding)
-
- # add new file
- repo.add(file_path_in_satellite)
-
- # commit the changes
- # will raise CommandFailed when commit fails
- repo.git.commit(raise: true, timeout: true, a: true, m: commit_message)
-
- target_branch = if new_branch.present? && !@project.empty_repo?
- "#{ref}:#{new_branch}"
- else
- "#{current_ref}:#{ref}"
- end
-
- # push commit back to bare repo
- # will raise CommandFailed when push fails
- repo.git.push({ raise: true, timeout: true }, :origin, target_branch)
-
- # everything worked
- true
- end
- rescue Grit::Git::CommandFailed => ex
- Gitlab::GitLogger.error(ex.message)
- false
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/logger.rb b/lib/gitlab/satellite/logger.rb
deleted file mode 100644
index 6f3f8255aca11e5b9c77bf98bd968a299e3c9756..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/logger.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module Gitlab
- module Satellite
- class Logger < Gitlab::Logger
- def self.file_name
- 'satellites.log'
- end
-
- def format_message(severity, timestamp, progname, msg)
- "#{timestamp.to_s(:long)}: #{msg}\n"
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb
deleted file mode 100644
index 1f2e5f82dd5348017eba0fa9385ef0e38357907a..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/merge_action.rb
+++ /dev/null
@@ -1,146 +0,0 @@
-module Gitlab
- module Satellite
- # GitLab server-side merge
- class MergeAction < Action
- attr_accessor :merge_request
-
- def initialize(user, merge_request)
- super user, merge_request.target_project
- @merge_request = merge_request
- end
-
- # Checks if a merge request can be executed without user interaction
- def can_be_merged?
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- merge_in_satellite!(merge_repo)
- end
- end
-
- # Merges the source branch into the target branch in the satellite and
- # pushes it back to the repository.
- # It also removes the source branch if requested in the merge request (and this is permitted by the merge request).
- #
- # Returns false if the merge produced conflicts
- # Returns false if pushing from the satellite to the repository failed or was rejected
- # Returns true otherwise
- def merge!(merge_commit_message = nil)
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- if merge_in_satellite!(merge_repo, merge_commit_message)
- # push merge back to bare repo
- # will raise CommandFailed when push fails
- merge_repo.git.push(default_options, :origin, merge_request.target_branch)
-
- # remove source branch
- if merge_request.should_remove_source_branch && !project.root_ref?(merge_request.source_branch) && !merge_request.for_fork?
- # will raise CommandFailed when push fails
- merge_repo.git.push(default_options, :origin, ":#{merge_request.source_branch}")
- end
- # merge, push and branch removal successful
- true
- end
- end
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- def diff_in_satellite
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- update_satellite_source_and_target!(merge_repo)
-
- # Only show what is new in the source branch compared to the target branch, not the other way around.
- # The line below with merge_base is equivalent to diff with three dots (git diff branch1...branch2)
- # From the git documentation: "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B"
- common_commit = merge_repo.git.native(:merge_base, default_options, ["origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}"]).strip
- merge_repo.git.native(:diff, default_options, common_commit, "source/#{merge_request.source_branch}")
- end
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- def diffs_between_satellite
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- update_satellite_source_and_target!(merge_repo)
- if merge_request.for_fork?
- repository = Gitlab::Git::Repository.new(merge_repo.path)
- diffs = Gitlab::Git::Diff.between(
- repository,
- "source/#{merge_request.source_branch}",
- "origin/#{merge_request.target_branch}"
- )
- else
- raise "Attempt to determine diffs between for a non forked merge request in satellite MergeRequest.id:[#{merge_request.id}]"
- end
-
- return diffs
- end
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- # Get commit as an email patch
- def format_patch
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- update_satellite_source_and_target!(merge_repo)
- patch = merge_repo.git.format_patch(default_options({ stdout: true }), "origin/#{merge_request.target_branch}..source/#{merge_request.source_branch}")
- end
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- # Retrieve an array of commits between the source and the target
- def commits_between
- in_locked_and_timed_satellite do |merge_repo|
- prepare_satellite!(merge_repo)
- update_satellite_source_and_target!(merge_repo)
- if merge_request.for_fork?
- repository = Gitlab::Git::Repository.new(merge_repo.path)
- commits = Gitlab::Git::Commit.between(
- repository,
- "origin/#{merge_request.target_branch}",
- "source/#{merge_request.source_branch}"
- )
- else
- raise "Attempt to determine commits between for a non forked merge request in satellite MergeRequest.id:[#{merge_request.id}]"
- end
-
- return commits
- end
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- private
- # Merges the source_branch into the target_branch in the satellite.
- #
- # Note: it will clear out the satellite before doing anything
- #
- # Returns false if the merge produced conflicts
- # Returns true otherwise
- def merge_in_satellite!(repo, message = nil)
- update_satellite_source_and_target!(repo)
-
- message ||= "Merge branch '#{merge_request.source_branch}' into '#{merge_request.target_branch}'"
-
- # merge the source branch into the satellite
- # will raise CommandFailed when merge fails
- repo.git.merge(default_options({ no_ff: true }), "-m#{message}", "source/#{merge_request.source_branch}")
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
-
- # Assumes a satellite exists that is a fresh clone of the projects repo, prepares satellite for merges, diffs etc
- def update_satellite_source_and_target!(repo)
- repo.remote_add('source', merge_request.source_project.repository.path_to_repo)
- repo.remote_fetch('source')
- repo.git.checkout(default_options({ b: true }), merge_request.target_branch, "origin/#{merge_request.target_branch}")
- rescue Grit::Git::CommandFailed => ex
- handle_exception(ex)
- end
- end
- end
-end
diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb
deleted file mode 100644
index 398643d68de2c07a56ba30181786f693dae6219a..0000000000000000000000000000000000000000
--- a/lib/gitlab/satellite/satellite.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-module Gitlab
- module Satellite
- autoload :DeleteFileAction, 'gitlab/satellite/files/delete_file_action'
- autoload :EditFileAction, 'gitlab/satellite/files/edit_file_action'
- autoload :FileAction, 'gitlab/satellite/files/file_action'
- autoload :NewFileAction, 'gitlab/satellite/files/new_file_action'
-
- class CheckoutFailed < StandardError; end
- class CommitFailed < StandardError; end
- class PushFailed < StandardError; end
-
- class Satellite
- include Gitlab::Popen
-
- PARKING_BRANCH = "__parking_branch"
-
- attr_accessor :project
-
- def initialize(project)
- @project = project
- end
-
- def log(message)
- Gitlab::Satellite::Logger.error(message)
- end
-
- def clear_and_update!
- project.ensure_satellite_exists
-
- @repo = nil
- clear_working_dir!
- delete_heads!
- remove_remotes!
- update_from_source!
- end
-
- def create
- output, status = popen(%W(git clone -- #{project.repository.path_to_repo} #{path}),
- Gitlab.config.satellites.path)
-
- log("PID: #{project.id}: git clone #{project.repository.path_to_repo} #{path}")
- log("PID: #{project.id}: -> #{output}")
-
- if status.zero?
- true
- else
- log("Failed to create satellite for #{project.name_with_namespace}")
- false
- end
- end
-
- def exists?
- File.exists? path
- end
-
- # * Locks the satellite
- # * Changes the current directory to the satellite's working dir
- # * Yields
- def lock
- project.ensure_satellite_exists
-
- File.open(lock_file, "w+") do |f|
- begin
- f.flock File::LOCK_EX
- yield
- ensure
- f.flock File::LOCK_UN
- end
- end
- end
-
- def lock_file
- create_locks_dir unless File.exists?(lock_files_dir)
- File.join(lock_files_dir, "satellite_#{project.id}.lock")
- end
-
- def path
- File.join(Gitlab.config.satellites.path, project.path_with_namespace)
- end
-
- def repo
- project.ensure_satellite_exists
-
- @repo ||= Grit::Repo.new(path)
- end
-
- def destroy
- FileUtils.rm_rf(path)
- end
-
- private
-
- # Clear the working directory
- def clear_working_dir!
- repo.git.reset(hard: true)
- repo.git.clean(f: true, d: true, x: true)
- end
-
- # Deletes all branches except the parking branch
- #
- # This ensures we have no name clashes or issues updating branches when
- # working with the satellite.
- def delete_heads!
- heads = repo.heads.map(&:name)
-
- # update or create the parking branch
- repo.git.checkout(default_options({ B: true }), PARKING_BRANCH)
-
- # remove the parking branch from the list of heads ...
- heads.delete(PARKING_BRANCH)
- # ... and delete all others
- heads.each { |head| repo.git.branch(default_options({ D: true }), head) }
- end
-
- # Deletes all remotes except origin
- #
- # This ensures we have no remote name clashes or issues updating branches when
- # working with the satellite.
- def remove_remotes!
- remotes = repo.git.remote.split(' ')
- remotes.delete('origin')
- remotes.each { |name| repo.git.remote(default_options,'rm', name)}
- end
-
- # Updates the satellite from bare repo
- #
- # Note: this will only update remote branches (i.e. origin/*)
- def update_from_source!
- repo.git.remote(default_options, 'set-url', :origin, project.repository.path_to_repo)
- repo.git.fetch(default_options, :origin)
- end
-
- def default_options(options = {})
- { raise: true, timeout: true }.merge(options)
- end
-
- # Create directory for storing
- # satellites lock files
- def create_locks_dir
- FileUtils.mkdir_p(lock_files_dir)
- end
-
- def lock_files_dir
- @lock_files_dir ||= File.join(Gitlab.config.satellites.path, "tmp")
- end
- end
- end
-end
diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb
deleted file mode 100644
index 75a3dfe37c3931262b1016d1102c704ea2c17f46..0000000000000000000000000000000000000000
--- a/lib/gitlab/search_results.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-module Gitlab
- class SearchResults
- attr_reader :query
-
- # Limit search results by passed project ids
- # It allows us to search only for projects user has access to
- attr_reader :limit_project_ids
-
- def initialize(limit_project_ids, query)
- @limit_project_ids = limit_project_ids || Project.all
- @query = Shellwords.shellescape(query) if query.present?
- end
-
- def objects(scope, page = nil)
- case scope
- when 'projects'
- projects.page(page).per(per_page)
- when 'issues'
- issues.page(page).per(per_page)
- when 'merge_requests'
- merge_requests.page(page).per(per_page)
- else
- Kaminari.paginate_array([]).page(page).per(per_page)
- end
- end
-
- def total_count
- @total_count ||= projects_count + issues_count + merge_requests_count
- end
-
- def projects_count
- @projects_count ||= projects.count
- end
-
- def issues_count
- @issues_count ||= issues.count
- end
-
- def merge_requests_count
- @merge_requests_count ||= merge_requests.count
- end
-
- def empty?
- total_count.zero?
- end
-
- private
-
- def projects
- Project.where(id: limit_project_ids).search(query)
- end
-
- def issues
- Issue.where(project_id: limit_project_ids).full_search(query).order('updated_at DESC')
- end
-
- def merge_requests
- MergeRequest.in_projects(limit_project_ids).full_search(query).order('updated_at DESC')
- end
-
- def default_scope
- 'projects'
- end
-
- def per_page
- 20
- end
- end
-end
diff --git a/lib/gitlab/seeder.rb b/lib/gitlab/seeder.rb
deleted file mode 100644
index 31aa3528c4c37a4aa4416da61e6d0df01368b9c0..0000000000000000000000000000000000000000
--- a/lib/gitlab/seeder.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-module Gitlab
- class Seeder
- def self.quiet
- mute_mailer
- SeedFu.quiet = true
- yield
- SeedFu.quiet = false
- puts "\nOK".green
- end
-
- def self.by_user(user)
- yield
- end
-
- def self.mute_mailer
- code = <<-eos
-def Notify.delay
- self
-end
- eos
- eval(code)
- end
- end
-end
diff --git a/lib/gitlab/sidekiq_logger.rb b/lib/gitlab/sidekiq_logger.rb
deleted file mode 100644
index c1dab87a43231c56ebe3ee01e9788771158ace90..0000000000000000000000000000000000000000
--- a/lib/gitlab/sidekiq_logger.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-module Gitlab
- class SidekiqLogger < Gitlab::Logger
- def self.file_name_noext
- 'sidekiq'
- end
- end
-end
diff --git a/lib/gitlab/sidekiq_middleware/arguments_logger.rb b/lib/gitlab/sidekiq_middleware/arguments_logger.rb
deleted file mode 100644
index 7813091ec7b44f8b74d647d4417183819493f363..0000000000000000000000000000000000000000
--- a/lib/gitlab/sidekiq_middleware/arguments_logger.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module Gitlab
- module SidekiqMiddleware
- class ArgumentsLogger
- def call(worker, job, queue)
- Sidekiq.logger.info "arguments: #{job['args']}"
- yield
- end
- end
- end
-end
diff --git a/lib/gitlab/sidekiq_middleware/memory_killer.rb b/lib/gitlab/sidekiq_middleware/memory_killer.rb
deleted file mode 100644
index 0f2db50e98c9625c28a6db405c36e94656cfb988..0000000000000000000000000000000000000000
--- a/lib/gitlab/sidekiq_middleware/memory_killer.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-module Gitlab
- module SidekiqMiddleware
- class MemoryKiller
- # Default the RSS limit to 0, meaning the MemoryKiller is disabled
- MAX_RSS = (ENV['SIDEKIQ_MEMORY_KILLER_MAX_RSS'] || 0).to_s.to_i
- # Give Sidekiq 15 minutes of grace time after exceeding the RSS limit
- GRACE_TIME = (ENV['SIDEKIQ_MEMORY_KILLER_GRACE_TIME'] || 15 * 60).to_s.to_i
- # Wait 30 seconds for running jobs to finish during graceful shutdown
- SHUTDOWN_WAIT = (ENV['SIDEKIQ_MEMORY_KILLER_SHUTDOWN_WAIT'] || 30).to_s.to_i
-
- # Create a mutex used to ensure there will be only one thread waiting to
- # shut Sidekiq down
- MUTEX = Mutex.new
-
- def call(worker, job, queue)
- yield
- current_rss = get_rss
-
- return unless MAX_RSS > 0 && current_rss > MAX_RSS
-
- Thread.new do
- # Return if another thread is already waiting to shut Sidekiq down
- return unless MUTEX.try_lock
-
- Sidekiq.logger.warn "current RSS #{current_rss} exceeds maximum RSS "\
- "#{MAX_RSS}"
- Sidekiq.logger.warn "spawned thread that will shut down PID "\
- "#{Process.pid} in #{GRACE_TIME} seconds"
- sleep(GRACE_TIME)
-
- Sidekiq.logger.warn "sending SIGUSR1 to PID #{Process.pid}"
- Process.kill('SIGUSR1', Process.pid)
-
- Sidekiq.logger.warn "waiting #{SHUTDOWN_WAIT} seconds before sending "\
- "SIGTERM to PID #{Process.pid}"
- sleep(SHUTDOWN_WAIT)
-
- Sidekiq.logger.warn "sending SIGTERM to PID #{Process.pid}"
- Process.kill('SIGTERM', Process.pid)
- end
- end
-
- private
-
- def get_rss
- output, status = Gitlab::Popen.popen(%W(ps -o rss= -p #{Process.pid}))
- return 0 unless status.zero?
-
- output.to_i
- end
- end
- end
-end
diff --git a/lib/gitlab/snippet_search_results.rb b/lib/gitlab/snippet_search_results.rb
deleted file mode 100644
index 938219efdb29d6cf75e2d84dad062e7a267243ec..0000000000000000000000000000000000000000
--- a/lib/gitlab/snippet_search_results.rb
+++ /dev/null
@@ -1,131 +0,0 @@
-module Gitlab
- class SnippetSearchResults < SearchResults
- attr_reader :limit_snippet_ids
-
- def initialize(limit_snippet_ids, query)
- @limit_snippet_ids = limit_snippet_ids
- @query = query
- end
-
- def objects(scope, page = nil)
- case scope
- when 'snippet_titles'
- Kaminari.paginate_array(snippet_titles).page(page).per(per_page)
- when 'snippet_blobs'
- Kaminari.paginate_array(snippet_blobs).page(page).per(per_page)
- else
- super
- end
- end
-
- def total_count
- @total_count ||= snippet_titles_count + snippet_blobs_count
- end
-
- def snippet_titles_count
- @snippet_titles_count ||= snippet_titles.count
- end
-
- def snippet_blobs_count
- @snippet_blobs_count ||= snippet_blobs.count
- end
-
- private
-
- def snippet_titles
- Snippet.where(id: limit_snippet_ids).search(query).order('updated_at DESC')
- end
-
- def snippet_blobs
- search = Snippet.where(id: limit_snippet_ids).search_code(query)
- search = search.order('updated_at DESC').to_a
- snippets = []
- search.each { |e| snippets << chunk_snippet(e) }
- snippets
- end
-
- def default_scope
- 'snippet_blobs'
- end
-
- # Get an array of line numbers surrounding a matching
- # line, bounded by min/max.
- #
- # @returns Array of line numbers
- def bounded_line_numbers(line, min, max)
- lower = line - surrounding_lines > min ? line - surrounding_lines : min
- upper = line + surrounding_lines < max ? line + surrounding_lines : max
- (lower..upper).to_a
- end
-
- # Returns a sorted set of lines to be included in a snippet preview.
- # This ensures matching adjacent lines do not display duplicated
- # surrounding code.
- #
- # @returns Array, unique and sorted.
- def matching_lines(lined_content)
- used_lines = []
- lined_content.each_with_index do |line, line_number|
- used_lines.concat bounded_line_numbers(
- line_number,
- 0,
- lined_content.size
- ) if line.include?(query)
- end
-
- used_lines.uniq.sort
- end
-
- # 'Chunkify' entire snippet. Splits the snippet data into matching lines +
- # surrounding_lines() worth of unmatching lines.
- #
- # @returns a hash with {snippet_object, snippet_chunks:{data,start_line}}
- def chunk_snippet(snippet)
- lined_content = snippet.content.split("\n")
- used_lines = matching_lines(lined_content)
-
- snippet_chunk = []
- snippet_chunks = []
- snippet_start_line = 0
- last_line = -1
-
- # Go through each used line, and add consecutive lines as a single chunk
- # to the snippet chunk array.
- used_lines.each do |line_number|
- if last_line < 0
- # Start a new chunk.
- snippet_start_line = line_number
- snippet_chunk << lined_content[line_number]
- elsif last_line == line_number - 1
- # Consecutive line, continue chunk.
- snippet_chunk << lined_content[line_number]
- else
- # Non-consecutive line, add chunk to chunk array.
- snippet_chunks << {
- data: snippet_chunk.join("\n"),
- start_line: snippet_start_line + 1
- }
-
- # Start a new chunk.
- snippet_chunk = [lined_content[line_number]]
- snippet_start_line = line_number
- end
- last_line = line_number
- end
- # Add final chunk to chunk array
- snippet_chunks << {
- data: snippet_chunk.join("\n"),
- start_line: snippet_start_line + 1
- }
-
- # Return snippet with chunk array
- { snippet_object: snippet, snippet_chunks: snippet_chunks }
- end
-
- # Defines how many unmatching lines should be
- # included around the matching lines in a snippet
- def surrounding_lines
- 3
- end
- end
-end
diff --git a/lib/gitlab/theme.rb b/lib/gitlab/theme.rb
deleted file mode 100644
index 43093c7d27ebbf804adef24176611b0a31ed6075..0000000000000000000000000000000000000000
--- a/lib/gitlab/theme.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-module Gitlab
- class Theme
- BASIC = 1 unless const_defined?(:BASIC)
- MARS = 2 unless const_defined?(:MARS)
- MODERN = 3 unless const_defined?(:MODERN)
- GRAY = 4 unless const_defined?(:GRAY)
- COLOR = 5 unless const_defined?(:COLOR)
- BLUE = 6 unless const_defined?(:BLUE)
-
- def self.css_class_by_id(id)
- themes = {
- BASIC => "ui_basic",
- MARS => "ui_mars",
- MODERN => "ui_modern",
- GRAY => "ui_gray",
- COLOR => "ui_color",
- BLUE => "ui_blue"
- }
-
- id ||= Gitlab.config.gitlab.default_theme
-
- themes[id]
- end
-
- def self.type_css_class_by_id(id)
- types = {
- BASIC => 'light_theme',
- MARS => 'dark_theme',
- MODERN => 'dark_theme',
- GRAY => 'dark_theme',
- COLOR => 'dark_theme'
- }
-
- id ||= Gitlab.config.gitlab.default_theme
-
- types[id]
- end
- end
-end
diff --git a/lib/gitlab/upgrader.rb b/lib/gitlab/upgrader.rb
deleted file mode 100644
index 0570c2fbeb53c11d0e091636ac18d02138c8a22d..0000000000000000000000000000000000000000
--- a/lib/gitlab/upgrader.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require_relative "popen"
-require_relative "version_info"
-
-module Gitlab
- class Upgrader
- def execute
- puts "GitLab #{current_version.major} upgrade tool"
- puts "Your version is #{current_version}"
- puts "Latest available version for GitLab #{current_version.major} is #{latest_version}"
-
- if latest_version?
- puts "You are using the latest GitLab version"
- else
- puts "Newer GitLab version is available"
- answer = if ARGV.first == "-y"
- "yes"
- else
- prompt("Do you want to upgrade (yes/no)? ", %w{yes no})
- end
-
- if answer == "yes"
- upgrade
- else
- exit 0
- end
- end
- end
-
- def latest_version?
- current_version >= latest_version
- end
-
- def current_version
- @current_version ||= Gitlab::VersionInfo.parse(current_version_raw)
- end
-
- def latest_version
- @latest_version ||= Gitlab::VersionInfo.parse(latest_version_raw)
- end
-
- def current_version_raw
- File.read(File.join(gitlab_path, "VERSION")).strip
- end
-
- def latest_version_raw
- remote_tags, _ = Gitlab::Popen.popen(%W(git ls-remote --tags https://gitlab.com/gitlab-org/gitlab-ce.git))
- git_tags = remote_tags.split("\n").grep(/tags\/v#{current_version.major}/)
- git_tags = git_tags.select { |version| version =~ /v\d\.\d\.\d\Z/ }
- last_tag = git_tags.last.match(/v\d\.\d\.\d/).to_s
- end
-
- def update_commands
- {
- "Stash changed files" => %W(git stash),
- "Get latest code" => %W(git fetch),
- "Switch to new version" => %W(git checkout v#{latest_version}),
- "Install gems" => %W(bundle),
- "Migrate DB" => %W(bundle exec rake db:migrate),
- "Recompile assets" => %W(bundle exec rake assets:clean assets:precompile),
- "Clear cache" => %W(bundle exec rake cache:clear)
- }
- end
-
- def env
- { 'RAILS_ENV' => 'production' }
- end
-
- def upgrade
- update_commands.each do |title, cmd|
- puts title
- puts " -> #{cmd.join(' ')}"
- if system(env, *cmd)
- puts " -> OK"
- else
- puts " -> FAILED"
- puts "Failed to upgrade. Try to repeat task or proceed with upgrade manually "
- exit 1
- end
- end
-
- puts "Done"
- end
-
- def gitlab_path
- File.expand_path(File.join(File.dirname(__FILE__), '../..'))
- end
-
- # Prompt the user to input something
- #
- # message - the message to display before input
- # choices - array of strings of acceptable answers or nil for any answer
- #
- # Returns the user's answer
- def prompt(message, choices = nil)
- begin
- print(message)
- answer = STDIN.gets.chomp
- end while !choices.include?(answer)
- answer
- end
- end
-end
diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb
deleted file mode 100644
index 11b0d44f34067e461f5410b16acd4081769e751e..0000000000000000000000000000000000000000
--- a/lib/gitlab/url_builder.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-module Gitlab
- class UrlBuilder
- include Rails.application.routes.url_helpers
- include GitlabRoutingHelper
-
- def initialize(type)
- @type = type
- end
-
- def build(id)
- case @type
- when :issue
- build_issue_url(id)
- when :merge_request
- build_merge_request_url(id)
- when :note
- build_note_url(id)
-
- end
- end
-
- private
-
- def build_issue_url(id)
- issue = Issue.find(id)
- issue_url(issue, host: Gitlab.config.gitlab['url'])
- end
-
- def build_merge_request_url(id)
- merge_request = MergeRequest.find(id)
- merge_request_url(merge_request, host: Gitlab.config.gitlab['url'])
- end
-
- def build_note_url(id)
- note = Note.find(id)
- if note.for_commit?
- namespace_project_commit_url(namespace_id: note.project.namespace,
- id: note.commit_id,
- project_id: note.project,
- host: Gitlab.config.gitlab['url'],
- anchor: "note_#{note.id}")
- elsif note.for_issue?
- issue = Issue.find(note.noteable_id)
- issue_url(issue,
- host: Gitlab.config.gitlab['url'],
- anchor: "note_#{note.id}")
- elsif note.for_merge_request?
- merge_request = MergeRequest.find(note.noteable_id)
- merge_request_url(merge_request,
- host: Gitlab.config.gitlab['url'],
- anchor: "note_#{note.id}")
- elsif note.for_project_snippet?
- snippet = Snippet.find(note.noteable_id)
- project_snippet_url(snippet,
- host: Gitlab.config.gitlab['url'],
- anchor: "note_#{note.id}")
- end
- end
- end
-end
diff --git a/lib/gitlab/user_access.rb b/lib/gitlab/user_access.rb
deleted file mode 100644
index 4885baf95265ff1a9d97b22c966c522452c25cf5..0000000000000000000000000000000000000000
--- a/lib/gitlab/user_access.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module Gitlab
- module UserAccess
- def self.allowed?(user)
- return false if user.blocked?
-
- if user.requires_ldap_check?
- return false unless Gitlab::LDAP::Access.allowed?(user)
- end
-
- true
- end
- end
-end
diff --git a/lib/gitlab/utils.rb b/lib/gitlab/utils.rb
deleted file mode 100644
index bd184c271871e83519f2c847b1f38e1e261a2bf7..0000000000000000000000000000000000000000
--- a/lib/gitlab/utils.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module Gitlab
- module Utils
- extend self
-
- # Run system command without outputting to stdout.
- #
- # @param cmd [Array404
- The page you were looking for doesn't exist.
-
- 422
- The change you wanted was rejected.
- 500
- We're sorry, but something went wrong.
-
- 502
- GitLab is not responding.
-
-
- 
Please try again in few minutes or contact your administrator.
-
-
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index bfb74960c480e6cb14f1d38437303af6b375ccaf..0000000000000000000000000000000000000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/gitlab_logo.png b/public/gitlab_logo.png
deleted file mode 100644
index dbe6dabb784f3f104908e2eefe79a887545d1075..0000000000000000000000000000000000000000
Binary files a/public/gitlab_logo.png and /dev/null differ
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index 085187fa58b1631e955f5d514d895a7721466797..0000000000000000000000000000000000000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
-#
-# To ban all spiders from the entire site uncomment the next two lines:
-# User-Agent: *
-# Disallow: /
diff --git a/public/static.css b/public/static.css
deleted file mode 100644
index c6f92ac01d90897ad9fd97c41ae715137d92d38d..0000000000000000000000000000000000000000
--- a/public/static.css
+++ /dev/null
@@ -1,30 +0,0 @@
-body {
- color: #666;
- text-align: center;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin:0;
- width: 800px;
- margin: auto;
- font-size: 14px;
-}
-h1 {
- font-size: 56px;
- line-height: 100px;
- font-weight: normal;
- color: #456;
-}
-h2 { font-size: 24px; color: #666; line-height: 1.5em; }
-
-h3 {
- color: #456;
- font-size: 20px;
- font-weight: normal;
- line-height: 28px;
-}
-
-hr {
- margin: 18px 0;
- border: 0;
- border-top: 1px solid #EEE;
- border-bottom: 1px solid white;
-}
diff --git a/public/uploads/.gitkeep b/public/uploads/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/safe/public.pem b/safe/public.pem
deleted file mode 100644
index c5ffe20a5c7bc19f5addf5e4aac0d9f099bcab19..0000000000000000000000000000000000000000
--- a/safe/public.pem
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnp2mUaLBoHFX127ysonX
-OihiGpI4098eFfH1iAxpKHIof0vs0jFF05IUScNXJZ1U3w8G1U/unY/wGGa3NzAb
-ZfDd22eOF6X2Gfiey6U4w9dFf0/UT5x1bphlpX357yh4O9oWWuNaWD062DTbOOsJ
-U6UW2U/sZAu/QScys0Nw+gJ58t93hb4jFq+nO5IAQc6g4S8ek5YvIXOshFEpF2in
-ZLbSYowx92+9GzfjvdQ7fk0Q2ssg0zfScVa6FY8n019osz0SC3wcSd/qicdfecpu
-7oycpd9YDqk4lufE1qVMOsgE8OO4KXMrByz2f+T0p/bH9zdBa5HYylf1T7i60hIL
-kQIDAQAB
------END PUBLIC KEY-----
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
deleted file mode 100644
index 186239d3096b6a548b41d8bf0348e446986f3380..0000000000000000000000000000000000000000
--- a/spec/controllers/application_controller_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-
-describe ApplicationController do
- describe '#check_password_expiration' do
- let(:user) { create(:user) }
- let(:controller) { ApplicationController.new }
-
- it 'should redirect if the user is over their password expiry' do
- user.password_expires_at = Time.new(2002)
- expect(user.ldap_user?).to be_falsey
- allow(controller).to receive(:current_user).and_return(user)
- expect(controller).to receive(:redirect_to)
- expect(controller).to receive(:new_profile_password_path)
- controller.send(:check_password_expiration)
- end
-
- it 'should not redirect if the user is under their password expiry' do
- user.password_expires_at = Time.now + 20010101
- expect(user.ldap_user?).to be_falsey
- allow(controller).to receive(:current_user).and_return(user)
- expect(controller).not_to receive(:redirect_to)
- controller.send(:check_password_expiration)
- end
-
- it 'should not redirect if the user is over their password expiry but they are an ldap user' do
- user.password_expires_at = Time.new(2002)
- allow(user).to receive(:ldap_user?).and_return(true)
- allow(controller).to receive(:current_user).and_return(user)
- expect(controller).not_to receive(:redirect_to)
- controller.send(:check_password_expiration)
- end
- end
-end
diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb
deleted file mode 100644
index a0909cec3bd6f77f916aa1e86b9284441e1b8ecc..0000000000000000000000000000000000000000
--- a/spec/controllers/autocomplete_controller_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe AutocompleteController do
- let!(:project) { create(:project) }
- let!(:user) { create(:user) }
- let!(:user2) { create(:user) }
-
- context 'project members' do
- before do
- sign_in(user)
- project.team << [user, :master]
-
- get(:users, project_id: project.id)
- end
-
- let(:body) { JSON.parse(response.body) }
-
- it { body.should be_kind_of(Array) }
- it { body.size.should eq(1) }
- it { body.first["username"].should == user.username }
- end
-
- context 'group members' do
- let(:group) { create(:group) }
-
- before do
- sign_in(user)
- group.add_owner(user)
-
- get(:users, group_id: group.id)
- end
-
- let(:body) { JSON.parse(response.body) }
-
- it { body.should be_kind_of(Array) }
- it { body.size.should eq(1) }
- it { body.first["username"].should == user.username }
- end
-
- context 'all users' do
- before do
- sign_in(user)
- get(:users)
- end
-
- let(:body) { JSON.parse(response.body) }
-
- it { body.should be_kind_of(Array) }
- it { body.size.should eq(User.count) }
- end
-end
diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb
deleted file mode 100644
index a1102f283406ca24dca53a0787ecdb3f48de08c2..0000000000000000000000000000000000000000
--- a/spec/controllers/blob_controller_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'spec_helper'
-
-describe Projects::BlobController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
-
- project.team << [user, :master]
-
- allow(project).to receive(:branches).and_return(['master', 'foo/bar/baz'])
- allow(project).to receive(:tags).and_return(['v1.0.0', 'v2.0.0'])
- controller.instance_variable_set(:@project, project)
- end
-
- describe "GET show" do
- render_views
-
- before do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: id)
- end
-
- context "valid branch, valid file" do
- let(:id) { 'master/README.md' }
- it { is_expected.to respond_with(:success) }
- end
-
- context "valid branch, invalid file" do
- let(:id) { 'master/invalid-path.rb' }
- it { is_expected.to respond_with(:not_found) }
- end
-
- context "invalid branch, valid file" do
- let(:id) { 'invalid-branch/README.md' }
- it { is_expected.to respond_with(:not_found) }
- end
- end
-
- describe 'GET show with tree path' do
- render_views
-
- before do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: id)
- controller.instance_variable_set(:@blob, nil)
- end
-
- context 'redirect to tree' do
- let(:id) { 'markdown/doc' }
- it 'redirects' do
- expect(subject).
- to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc")
- end
- end
- end
-end
diff --git a/spec/controllers/branches_controller_spec.rb b/spec/controllers/branches_controller_spec.rb
deleted file mode 100644
index 51397382cfbc107fc8cd4caf658195b078c4f631..0000000000000000000000000000000000000000
--- a/spec/controllers/branches_controller_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'spec_helper'
-
-describe Projects::BranchesController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
-
- project.team << [user, :master]
-
- allow(project).to receive(:branches).and_return(['master', 'foo/bar/baz'])
- allow(project).to receive(:tags).and_return(['v1.0.0', 'v2.0.0'])
- controller.instance_variable_set(:@project, project)
- end
-
- describe "POST create" do
- render_views
-
- before {
- post :create,
- namespace_id: project.namespace.to_param,
- project_id: project.to_param,
- branch_name: branch,
- ref: ref
- }
-
- context "valid branch name, valid source" do
- let(:branch) { "merge_branch" }
- let(:ref) { "master" }
- it 'redirects' do
- expect(subject).
- to redirect_to("/#{project.path_with_namespace}/tree/merge_branch")
- end
- end
-
- context "invalid branch name, valid ref" do
- let(:branch) { "" }
- let(:ref) { "master" }
- it 'redirects' do
- expect(subject).
- to redirect_to("/#{project.path_with_namespace}/tree/alert('merge');")
- end
- end
-
- context "valid branch name, invalid ref" do
- let(:branch) { "merge_branch" }
- let(:ref) { "" }
- it { is_expected.to render_template('new') }
- end
-
- context "invalid branch name, invalid ref" do
- let(:branch) { "" }
- let(:ref) { "" }
- it { is_expected.to render_template('new') }
- end
- end
-end
diff --git a/spec/controllers/commit_controller_spec.rb b/spec/controllers/commit_controller_spec.rb
deleted file mode 100644
index 3394a1f863fa1f12477a2ea0466c186e14120a12..0000000000000000000000000000000000000000
--- a/spec/controllers/commit_controller_spec.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-require 'spec_helper'
-
-describe Projects::CommitController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:commit) { project.repository.commit("master") }
-
- before do
- sign_in(user)
- project.team << [user, :master]
- end
-
- describe "#show" do
- shared_examples "export as" do |format|
- it "should generally work" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response).to be_success
- end
-
- it "should generate it" do
- expect_any_instance_of(Commit).to receive(:"to_#{format}")
-
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
- end
-
- it "should render it" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response.body).to eq(commit.send(:"to_#{format}"))
- end
-
- it "should not escape Html" do
- allow_any_instance_of(Commit).to receive(:"to_#{format}").
- and_return('HTML entities &<>" ')
-
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response.body).to_not include('&')
- expect(response.body).to_not include('>')
- expect(response.body).to_not include('<')
- expect(response.body).to_not include('"')
- end
- end
-
- describe "as diff" do
- include_examples "export as", :diff
- let(:format) { :diff }
-
- it "should really only be a git diff" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response.body).to start_with("diff --git")
- end
- end
-
- describe "as patch" do
- include_examples "export as", :patch
- let(:format) { :patch }
-
- it "should really be a git email patch" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response.body).to start_with("From #{commit.id}")
- end
-
- it "should contain a git diff" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id, format: format)
-
- expect(response.body).to match(/^diff --git/)
- end
- end
- end
-
- describe "#branches" do
- it "contains branch and tags information" do
- get(:branches, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: commit.id)
-
- expect(assigns(:branches)).to include("master", "feature_conflict")
- expect(assigns(:tags)).to include("v1.1.0")
- end
- end
-end
diff --git a/spec/controllers/commits_controller_spec.rb b/spec/controllers/commits_controller_spec.rb
deleted file mode 100644
index 2184b35152eadfb20740aba0b8a3908a9d09c37a..0000000000000000000000000000000000000000
--- a/spec/controllers/commits_controller_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'spec_helper'
-
-describe Projects::CommitsController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
- project.team << [user, :master]
- end
-
- describe "GET show" do
- context "as atom feed" do
- it "should render as atom" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: "master", format: "atom")
- expect(response).to be_success
- expect(response.content_type).to eq('application/atom+xml')
- end
- end
- end
-end
diff --git a/spec/controllers/import/bitbucket_controller_spec.rb b/spec/controllers/import/bitbucket_controller_spec.rb
deleted file mode 100644
index c31563e6d77c55d7de57214ebe76bfe4ff95f6ef..0000000000000000000000000000000000000000
--- a/spec/controllers/import/bitbucket_controller_spec.rb
+++ /dev/null
@@ -1,163 +0,0 @@
-require 'spec_helper'
-
-describe Import::BitbucketController do
- let(:user) { create(:user, bitbucket_access_token: 'asd123', bitbucket_access_token_secret: "sekret") }
-
- before do
- sign_in(user)
- controller.stub(:bitbucket_import_enabled?).and_return(true)
- end
-
- describe "GET callback" do
- before do
- session[:oauth_request_token] = {}
- end
-
- it "updates access token" do
- token = "asdasd12345"
- secret = "sekrettt"
- access_token = double(token: token, secret: secret)
- Gitlab::BitbucketImport::Client.any_instance.stub(:get_token).and_return(access_token)
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket")
-
- get :callback
-
- expect(user.reload.bitbucket_access_token).to eq(token)
- expect(user.reload.bitbucket_access_token_secret).to eq(secret)
- expect(controller).to redirect_to(status_import_bitbucket_url)
- end
- end
-
- describe "GET status" do
- before do
- @repo = OpenStruct.new(slug: 'vim', owner: 'asd')
- end
-
- it "assigns variables" do
- @project = create(:project, import_type: 'bitbucket', creator_id: user.id)
- controller.stub_chain(:client, :projects).and_return([@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: 'bitbucket', creator_id: user.id, import_source: 'asd/vim')
- controller.stub_chain(:client, :projects).and_return([@repo])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([])
- end
- end
-
- describe "POST create" do
- let(:bitbucket_username) { user.username }
-
- let(:bitbucket_user) {
- {
- user: {
- username: bitbucket_username
- }
- }.with_indifferent_access
- }
-
- let(:bitbucket_repo) {
- {
- slug: "vim",
- owner: bitbucket_username
- }.with_indifferent_access
- }
-
- before do
- allow(Gitlab::BitbucketImport::KeyAdder).
- to receive(:new).with(bitbucket_repo, user).
- and_return(double(execute: true))
-
- controller.stub_chain(:client, :user).and_return(bitbucket_user)
- controller.stub_chain(:client, :project).and_return(bitbucket_repo)
- end
-
- context "when the repository owner is the Bitbucket user" do
- context "when the Bitbucket user and GitLab user's usernames match" do
- it "takes the current user's namespace" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- to receive(:new).with(bitbucket_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the Bitbucket user and GitLab user's usernames don't match" do
- let(:bitbucket_username) { "someone_else" }
-
- it "takes the current user's namespace" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- to receive(:new).with(bitbucket_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
-
- context "when the repository owner is not the Bitbucket user" do
- let(:other_username) { "someone_else" }
-
- before do
- bitbucket_repo["owner"] = other_username
- end
-
- context "when a namespace with the Bitbucket user's username already exists" do
- let!(:existing_namespace) { create(:namespace, name: other_username, owner: user) }
-
- context "when the namespace is owned by the GitLab user" do
- it "takes the existing namespace" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- to receive(:new).with(bitbucket_repo, existing_namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the namespace is not owned by the GitLab user" do
- before do
- existing_namespace.owner = create(:user)
- existing_namespace.save
- end
-
- it "doesn't create a project" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- not_to receive(:new)
-
- post :create, format: :js
- end
- end
- end
-
- context "when a namespace with the Bitbucket user's username doesn't exist" do
- it "creates the namespace" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- to receive(:new).and_return(double(execute: true))
-
- post :create, format: :js
-
- expect(Namespace.where(name: other_username).first).not_to be_nil
- end
-
- it "takes the new namespace" do
- expect(Gitlab::BitbucketImport::ProjectCreator).
- to receive(:new).with(bitbucket_repo, an_instance_of(Group), user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
- end
-end
diff --git a/spec/controllers/import/github_controller_spec.rb b/spec/controllers/import/github_controller_spec.rb
deleted file mode 100644
index 3d3846b2e3a9a6fd42b0d5ce627993ad537447d3..0000000000000000000000000000000000000000
--- a/spec/controllers/import/github_controller_spec.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-require 'spec_helper'
-
-describe Import::GithubController do
- let(:user) { create(:user, github_access_token: 'asd123') }
-
- before do
- sign_in(user)
- controller.stub(:github_import_enabled?).and_return(true)
- end
-
- describe "GET callback" do
- it "updates access token" do
- token = "asdasd12345"
- allow_any_instance_of(Gitlab::GithubImport::Client).
- to receive(:get_token).and_return(token)
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: 'asd123',
- app_secret: 'asd123',
- name: 'github')
-
- get :callback
-
- expect(user.reload.github_access_token).to eq(token)
- expect(controller).to redirect_to(status_import_github_url)
- end
- end
-
- describe "GET status" do
- before do
- @repo = OpenStruct.new(login: 'vim', full_name: 'asd/vim')
- @org = OpenStruct.new(login: 'company')
- @org_repo = OpenStruct.new(login: 'company', full_name: 'company/repo')
- end
-
- it "assigns variables" do
- @project = create(:project, import_type: 'github', creator_id: user.id)
- controller.stub_chain(:client, :repos).and_return([@repo])
- controller.stub_chain(:client, :orgs).and_return([@org])
- controller.stub_chain(:client, :org_repos).with(@org.login).and_return([@org_repo])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([@repo, @org_repo])
- end
-
- it "does not show already added project" do
- @project = create(:project, import_type: 'github', creator_id: user.id, import_source: 'asd/vim')
- controller.stub_chain(:client, :repos).and_return([@repo])
- controller.stub_chain(:client, :orgs).and_return([])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([])
- end
- end
-
- describe "POST create" do
- let(:github_username) { user.username }
-
- let(:github_user) {
- OpenStruct.new(login: github_username)
- }
-
- let(:github_repo) {
- OpenStruct.new(name: 'vim', full_name: "#{github_username}/vim", owner: OpenStruct.new(login: github_username))
- }
-
- before do
- controller.stub_chain(:client, :user).and_return(github_user)
- controller.stub_chain(:client, :repo).and_return(github_repo)
- end
-
- context "when the repository owner is the GitHub user" do
- context "when the GitHub user and GitLab user's usernames match" do
- it "takes the current user's namespace" do
- expect(Gitlab::GithubImport::ProjectCreator).
- to receive(:new).with(github_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the GitHub user and GitLab user's usernames don't match" do
- let(:github_username) { "someone_else" }
-
- it "takes the current user's namespace" do
- expect(Gitlab::GithubImport::ProjectCreator).
- to receive(:new).with(github_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
-
- context "when the repository owner is not the GitHub user" do
- let(:other_username) { "someone_else" }
-
- before do
- github_repo.owner = OpenStruct.new(login: other_username)
- end
-
- context "when a namespace with the GitHub user's username already exists" do
- let!(:existing_namespace) { create(:namespace, name: other_username, owner: user) }
-
- context "when the namespace is owned by the GitLab user" do
- it "takes the existing namespace" do
- expect(Gitlab::GithubImport::ProjectCreator).
- to receive(:new).with(github_repo, existing_namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the namespace is not owned by the GitLab user" do
- before do
- existing_namespace.owner = create(:user)
- existing_namespace.save
- end
-
- it "doesn't create a project" do
- expect(Gitlab::GithubImport::ProjectCreator).
- not_to receive(:new)
-
- post :create, format: :js
- end
- end
- end
-
- context "when a namespace with the GitHub user's username doesn't exist" do
- it "creates the namespace" do
- expect(Gitlab::GithubImport::ProjectCreator).
- to receive(:new).and_return(double(execute: true))
-
- post :create, format: :js
-
- expect(Namespace.where(name: other_username).first).not_to be_nil
- end
-
- it "takes the new namespace" do
- expect(Gitlab::GithubImport::ProjectCreator).
- to receive(:new).with(github_repo, an_instance_of(Group), user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
- end
-end
diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb
deleted file mode 100644
index 112e51d431ecf40570e8f26cf79dc580b6311f7d..0000000000000000000000000000000000000000
--- a/spec/controllers/import/gitlab_controller_spec.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-require 'spec_helper'
-
-describe Import::GitlabController do
- let(:user) { create(:user, gitlab_access_token: 'asd123') }
-
- before do
- sign_in(user)
- controller.stub(:gitlab_import_enabled?).and_return(true)
- end
-
- describe "GET callback" do
- it "updates access token" do
- token = "asdasd12345"
- Gitlab::GitlabImport::Client.any_instance.stub_chain(:client, :auth_code, :get_token, :token).and_return(token)
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "gitlab")
-
- get :callback
-
- expect(user.reload.gitlab_access_token).to eq(token)
- expect(controller).to redirect_to(status_import_gitlab_url)
- end
- end
-
- describe "GET status" do
- before do
- @repo = OpenStruct.new(path: 'vim', path_with_namespace: 'asd/vim')
- end
-
- it "assigns variables" do
- @project = create(:project, import_type: 'gitlab', creator_id: user.id)
- controller.stub_chain(:client, :projects).and_return([@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: 'gitlab', creator_id: user.id, import_source: 'asd/vim')
- controller.stub_chain(:client, :projects).and_return([@repo])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([])
- end
- end
-
- describe "POST create" do
- let(:gitlab_username) { user.username }
-
- let(:gitlab_user) {
- {
- username: gitlab_username
- }.with_indifferent_access
- }
-
- let(:gitlab_repo) {
- {
- path: 'vim',
- path_with_namespace: "#{gitlab_username}/vim",
- owner: { name: gitlab_username },
- namespace: { path: gitlab_username }
- }.with_indifferent_access
- }
-
- before do
- controller.stub_chain(:client, :user).and_return(gitlab_user)
- controller.stub_chain(:client, :project).and_return(gitlab_repo)
- end
-
- context "when the repository owner is the GitLab.com user" do
- context "when the GitLab.com user and GitLab server user's usernames match" do
- it "takes the current user's namespace" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- to receive(:new).with(gitlab_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the GitLab.com user and GitLab server user's usernames don't match" do
- let(:gitlab_username) { "someone_else" }
-
- it "takes the current user's namespace" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- to receive(:new).with(gitlab_repo, user.namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
-
- context "when the repository owner is not the GitLab.com user" do
- let(:other_username) { "someone_else" }
-
- before do
- gitlab_repo["namespace"]["path"] = other_username
- end
-
- context "when a namespace with the GitLab.com user's username already exists" do
- let!(:existing_namespace) { create(:namespace, name: other_username, owner: user) }
-
- context "when the namespace is owned by the GitLab server user" do
- it "takes the existing namespace" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- to receive(:new).with(gitlab_repo, existing_namespace, user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
-
- context "when the namespace is not owned by the GitLab server user" do
- before do
- existing_namespace.owner = create(:user)
- existing_namespace.save
- end
-
- it "doesn't create a project" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- not_to receive(:new)
-
- post :create, format: :js
- end
- end
- end
-
- context "when a namespace with the GitLab.com user's username doesn't exist" do
- it "creates the namespace" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- to receive(:new).and_return(double(execute: true))
-
- post :create, format: :js
-
- expect(Namespace.where(name: other_username).first).not_to be_nil
- end
-
- it "takes the new namespace" do
- expect(Gitlab::GitlabImport::ProjectCreator).
- to receive(:new).with(gitlab_repo, an_instance_of(Group), user).
- and_return(double(execute: true))
-
- post :create, format: :js
- end
- end
- end
- end
-end
diff --git a/spec/controllers/import/gitorious_controller_spec.rb b/spec/controllers/import/gitorious_controller_spec.rb
deleted file mode 100644
index 07c9484bf1a2fafa2e98ccb64b0546dbcb5718d4..0000000000000000000000000000000000000000
--- a/spec/controllers/import/gitorious_controller_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require 'spec_helper'
-
-describe Import::GitoriousController do
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
- end
-
- describe "GET new" do
- it "redirects to import endpoint on gitorious.org" do
- get :new
-
- expect(controller).to redirect_to("https://gitorious.org/gitlab-import?callback_url=http://test.host/import/gitorious/callback")
- end
- end
-
- describe "GET callback" do
- it "stores repo list in session" do
- get :callback, repos: 'foo/bar,baz/qux'
-
- expect(session[:gitorious_repos]).to eq('foo/bar,baz/qux')
- end
- end
-
- describe "GET status" do
- before do
- @repo = OpenStruct.new(full_name: 'asd/vim')
- end
-
- it "assigns variables" do
- @project = create(:project, import_type: 'gitorious', creator_id: user.id)
- controller.stub_chain(:client, :repos).and_return([@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: 'gitorious', creator_id: user.id, import_source: 'asd/vim')
- controller.stub_chain(:client, :repos).and_return([@repo])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([])
- end
- end
-
- describe "POST create" do
- before do
- @repo = Gitlab::GitoriousImport::Repository.new('asd/vim')
- end
-
- it "takes already existing namespace" do
- namespace = create(:namespace, name: "asd", owner: user)
- expect(Gitlab::GitoriousImport::ProjectCreator).
- to receive(:new).with(@repo, namespace, user).
- and_return(double(execute: true))
- controller.stub_chain(:client, :repo).and_return(@repo)
-
- post :create, format: :js
- end
- end
-end
diff --git a/spec/controllers/import/google_code_controller_spec.rb b/spec/controllers/import/google_code_controller_spec.rb
deleted file mode 100644
index 037cddb460020c34af6a489de6707f0a86f02fd6..0000000000000000000000000000000000000000
--- a/spec/controllers/import/google_code_controller_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'spec_helper'
-
-describe Import::GoogleCodeController do
- let(:user) { create(:user) }
- let(:dump_file) { fixture_file_upload(Rails.root + 'spec/fixtures/GoogleCodeProjectHosting.json', 'application/json') }
-
- before do
- sign_in(user)
- end
-
- describe "POST callback" do
- it "stores Google Takeout dump list in session" do
- post :callback, dump_file: dump_file
-
- expect(session[:google_code_dump]).to be_a(Hash)
- expect(session[:google_code_dump]["kind"]).to eq("projecthosting#user")
- expect(session[:google_code_dump]).to have_key("projects")
- end
- end
-
- describe "GET status" do
- before do
- @repo = OpenStruct.new(name: 'vim')
- controller.stub_chain(:client, :valid?).and_return(true)
- end
-
- it "assigns variables" do
- @project = create(:project, import_type: 'google_code', creator_id: user.id)
- controller.stub_chain(:client, :repos).and_return([@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: 'google_code', creator_id: user.id, import_source: 'vim')
- controller.stub_chain(:client, :repos).and_return([@repo])
-
- get :status
-
- expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([])
- end
- end
-end
diff --git a/spec/controllers/merge_requests_controller_spec.rb b/spec/controllers/merge_requests_controller_spec.rb
deleted file mode 100644
index d6f56ed33d69ba73ff1d66049dbe815b794459c3..0000000000000000000000000000000000000000
--- a/spec/controllers/merge_requests_controller_spec.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'spec_helper'
-
-describe Projects::MergeRequestsController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
-
- before do
- sign_in(user)
- project.team << [user, :master]
- end
-
- describe "#show" do
- shared_examples "export merge as" do |format|
- it "should generally work" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response).to be_success
- end
-
- it "should generate it" do
- expect_any_instance_of(MergeRequest).to receive(:"to_#{format}")
-
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
- end
-
- it "should render it" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response.body).to eq((merge_request.send(:"to_#{format}",user)).to_s)
- end
-
- it "should not escape Html" do
- allow_any_instance_of(MergeRequest).to receive(:"to_#{format}").
- and_return('HTML entities &<>" ')
-
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response.body).to_not include('&')
- expect(response.body).to_not include('>')
- expect(response.body).to_not include('<')
- expect(response.body).to_not include('"')
- end
- end
-
- describe "as diff" do
- include_examples "export merge as", :diff
- let(:format) { :diff }
-
- it "should really only be a git diff" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response.body).to start_with("diff --git")
- end
- end
-
- describe "as patch" do
- include_examples "export merge as", :patch
- let(:format) { :patch }
-
- it "should really be a git email patch with commit" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response.body[0..100]).to start_with("From #{merge_request.commits.last.id}")
- end
-
- it "should contain git diffs" do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: merge_request.iid, format: format)
-
- expect(response.body).to match(/^diff --git/)
- end
- end
- end
-end
diff --git a/spec/controllers/namespaces_controller_spec.rb b/spec/controllers/namespaces_controller_spec.rb
deleted file mode 100644
index 9c8619722cd967e5bdcde87b42e0e5ca77dbf921..0000000000000000000000000000000000000000
--- a/spec/controllers/namespaces_controller_spec.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require 'spec_helper'
-
-describe NamespacesController do
- let!(:user) { create(:user, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
-
- describe "GET show" do
- context "when the namespace belongs to a user" do
- let!(:other_user) { create(:user) }
-
- it "redirects to the user's page" do
- get :show, id: other_user.username
-
- expect(response).to redirect_to(user_path(other_user))
- end
- end
-
- context "when the namespace belongs to a group" do
- let!(:group) { create(:group) }
- let!(:project) { create(:project, namespace: group) }
-
- context "when the group has public projects" do
- before do
- project.update_attribute(:visibility_level, Project::PUBLIC)
- end
-
- context "when not signed in" do
- it "redirects to the group's page" do
- get :show, id: group.path
-
- expect(response).to redirect_to(group_path(group))
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- it "redirects to the group's page" do
- get :show, id: group.path
-
- expect(response).to redirect_to(group_path(group))
- end
- end
- end
-
- context "when the project doesn't have public projects" do
- context "when not signed in" do
- it "redirects to the sign in page" do
- get :show, id: group.path
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- context "when the user has access to the project" do
- before do
- project.team << [user, :master]
- end
-
- context "when the user is blocked" do
- before do
- user.block
- project.team << [user, :master]
- end
-
- it "redirects to the sign in page" do
- get :show, id: group.path
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when the user isn't blocked" do
- it "redirects to the group's page" do
- get :show, id: group.path
-
- expect(response).to redirect_to(group_path(group))
- end
- end
- end
-
- context "when the user doesn't have access to the project" do
- it "responds with status 404" do
- get :show, id: group.path
-
- expect(response.status).to eq(404)
- end
- end
- end
- end
- end
-
- context "when the namespace doesn't exist" do
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- it "responds with status 404" do
- get :show, id: "doesntexist"
-
- expect(response.status).to eq(404)
- end
- end
-
- context "when not signed in" do
- it "redirects to the sign in page" do
- get :show, id: "doesntexist"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
- end
- end
-end
diff --git a/spec/controllers/profile_keys_controller_spec.rb b/spec/controllers/profile_keys_controller_spec.rb
deleted file mode 100644
index 593d3e9eb56af120129125ae213e2e668838857c..0000000000000000000000000000000000000000
--- a/spec/controllers/profile_keys_controller_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'spec_helper'
-
-describe Profiles::KeysController do
- let(:user) { create(:user) }
-
- describe "#get_keys" do
- describe "non existant user" do
- it "should generally not work" do
- get :get_keys, username: 'not-existent'
-
- expect(response).not_to be_success
- end
- end
-
- describe "user with no keys" do
- it "should generally work" do
- get :get_keys, username: user.username
-
- expect(response).to be_success
- end
-
- it "should render all keys separated with a new line" do
- get :get_keys, username: user.username
-
- expect(response.body).to eq("")
- end
-
- it "should respond with text/plain content type" do
- get :get_keys, username: user.username
- expect(response.content_type).to eq("text/plain")
- end
- end
-
- describe "user with keys" do
- before do
- user.keys << create(:key)
- user.keys << create(:another_key)
- end
-
- it "should generally work" do
- get :get_keys, username: user.username
-
- expect(response).to be_success
- end
-
- it "should render all keys separated with a new line" do
- get :get_keys, username: user.username
-
- expect(response.body).not_to eq("")
- expect(response.body).to eq(user.all_ssh_keys.join("\n"))
- end
-
- it "should respond with text/plain content type" do
- get :get_keys, username: user.username
- expect(response.content_type).to eq("text/plain")
- end
- end
- end
-end
diff --git a/spec/controllers/projects/protected_branches_controller_spec.rb b/spec/controllers/projects/protected_branches_controller_spec.rb
deleted file mode 100644
index 596d8d34b7c9a69045afda7cbcee09635c230eed..0000000000000000000000000000000000000000
--- a/spec/controllers/projects/protected_branches_controller_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require('spec_helper')
-
-describe Projects::ProtectedBranchesController do
- describe "GET #index" do
- let(:project) { create(:project_empty_repo, :public) }
- it "redirect empty repo to projects page" do
- get(:index, namespace_id: project.namespace.to_param, project_id: project.to_param)
- end
- end
-end
diff --git a/spec/controllers/projects/refs_controller_spec.rb b/spec/controllers/projects/refs_controller_spec.rb
deleted file mode 100644
index c254ab7cb6ea518b11c7e80242ead3859e4026e3..0000000000000000000000000000000000000000
--- a/spec/controllers/projects/refs_controller_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe Projects::RefsController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
- project.team << [user, :developer]
- end
-
- describe 'GET #logs_tree' do
- def default_get(format = :html)
- get :logs_tree, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: 'master',
- path: 'foo/bar/baz.html', format: format
- end
-
- def xhr_get(format = :html)
- xhr :get, :logs_tree, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: 'master',
- path: 'foo/bar/baz.html', format: format
- end
-
- it 'never throws MissingTemplate' do
- expect { default_get }.not_to raise_error
- expect { xhr_get }.not_to raise_error
- end
-
- it 'renders 404 for non-JS requests' do
- xhr_get
-
- expect(response).to be_not_found
- end
-
- it 'renders JS' do
- xhr_get(:js)
- expect(response).to be_success
- end
- end
-end
diff --git a/spec/controllers/projects/repositories_controller_spec.rb b/spec/controllers/projects/repositories_controller_spec.rb
deleted file mode 100644
index 91856ed0cc0341fbd49a0e7d98be6ae3bd63c385..0000000000000000000000000000000000000000
--- a/spec/controllers/projects/repositories_controller_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require "spec_helper"
-
-describe Projects::RepositoriesController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- describe "GET archive" do
- before do
- sign_in(user)
- project.team << [user, :developer]
-
- allow(ArchiveRepositoryService).to receive(:new).and_return(service)
- end
-
- let(:service) { ArchiveRepositoryService.new(project, "master", "zip") }
-
- it "executes ArchiveRepositoryService" do
- expect(ArchiveRepositoryService).to receive(:new).with(project, "master", "zip")
- expect(service).to receive(:execute)
-
- get :archive, namespace_id: project.namespace.path, project_id: project.path, ref: "master", format: "zip"
- end
-
- context "when the service raises an error" do
-
- before do
- allow(service).to receive(:execute).and_raise("Archive failed")
- end
-
- it "renders Not Found" do
- get :archive, namespace_id: project.namespace.path, project_id: project.path, ref: "master", format: "zip"
-
- expect(response.status).to eq(404)
- end
- end
-
- context "when the service doesn't return a path" do
-
- before do
- allow(service).to receive(:execute).and_return(nil)
- end
-
- it "reloads the page" do
- get :archive, namespace_id: project.namespace.path, project_id: project.path, ref: "master", format: "zip"
-
- expect(response).to redirect_to(archive_namespace_project_repository_path(project.namespace, project, ref: "master", format: "zip"))
- end
- end
-
- context "when the service returns a path" do
-
- let(:path) { Rails.root.join("spec/fixtures/dk.png").to_s }
-
- before do
- allow(service).to receive(:execute).and_return(path)
- end
-
- it "sends the file" do
- get :archive, namespace_id: project.namespace.path, project_id: project.path, ref: "master", format: "zip"
-
- expect(response.body).to eq(File.binread(path))
- end
- end
- end
-end
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
deleted file mode 100644
index a1b82a32150f7714c239b536e2d923331208292c..0000000000000000000000000000000000000000
--- a/spec/controllers/projects_controller_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require('spec_helper')
-
-describe ProjectsController do
- let(:project) { create(:project) }
- let(:public_project) { create(:project, :public) }
- let(:user) { create(:user) }
- let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') }
- let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') }
-
- describe "GET show" do
-
- context "when requested by `go get`" do
- render_views
-
- it "renders the go-import meta tag" do
- get :show, "go-get" => "1", namespace_id: "bogus_namespace", id: "bogus_project"
-
- expect(response.body).to include("name='go-import'")
-
- content = "localhost/bogus_namespace/bogus_project git http://localhost/bogus_namespace/bogus_project.git"
- expect(response.body).to include("content='#{content}'")
- end
- end
- end
-
- describe "POST #toggle_star" do
- it "toggles star if user is signed in" do
- sign_in(user)
- expect(user.starred?(public_project)).to be_falsey
- post(:toggle_star, namespace_id: public_project.namespace.to_param,
- id: public_project.to_param)
- expect(user.starred?(public_project)).to be_truthy
- post(:toggle_star, namespace_id: public_project.namespace.to_param,
- id: public_project.to_param)
- expect(user.starred?(public_project)).to be_falsey
- end
-
- it "does nothing if user is not signed in" do
- post(:toggle_star, namespace_id: project.namespace.to_param,
- id: public_project.to_param)
- expect(user.starred?(public_project)).to be_falsey
- post(:toggle_star, namespace_id: project.namespace.to_param,
- id: public_project.to_param)
- expect(user.starred?(public_project)).to be_falsey
- end
- end
-end
diff --git a/spec/controllers/tree_controller_spec.rb b/spec/controllers/tree_controller_spec.rb
deleted file mode 100644
index 7b219819bbce79e4b6f44015c6a7f31b2eb4fb21..0000000000000000000000000000000000000000
--- a/spec/controllers/tree_controller_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'spec_helper'
-
-describe Projects::TreeController do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- before do
- sign_in(user)
-
- project.team << [user, :master]
-
- allow(project).to receive(:branches).and_return(['master', 'foo/bar/baz'])
- allow(project).to receive(:tags).and_return(['v1.0.0', 'v2.0.0'])
- controller.instance_variable_set(:@project, project)
- end
-
- describe "GET show" do
- # Make sure any errors accessing the tree in our views bubble up to this spec
- render_views
-
- before do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: id)
- end
-
- context "valid branch, no path" do
- let(:id) { 'master' }
- it { is_expected.to respond_with(:success) }
- end
-
- context "valid branch, valid path" do
- let(:id) { 'master/encoding/' }
- it { is_expected.to respond_with(:success) }
- end
-
- context "valid branch, invalid path" do
- let(:id) { 'master/invalid-path/' }
- it { is_expected.to respond_with(:not_found) }
- end
-
- context "invalid branch, valid path" do
- let(:id) { 'invalid-branch/encoding/' }
- it { is_expected.to respond_with(:not_found) }
- end
- end
-
- describe 'GET show with blob path' do
- render_views
-
- before do
- get(:show, namespace_id: project.namespace.to_param,
- project_id: project.to_param, id: id)
- end
-
- context 'redirect to blob' do
- let(:id) { 'master/README.md' }
- it 'redirects' do
- redirect_url = "/#{project.path_with_namespace}/blob/master/README.md"
- expect(subject).
- to redirect_to(redirect_url)
- end
- end
- end
-end
diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb
deleted file mode 100644
index 0f9780356b1b0920942b8788475205fa38d200e9..0000000000000000000000000000000000000000
--- a/spec/controllers/uploads_controller_spec.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-require 'spec_helper'
-
-describe UploadsController do
- let!(:user) { create(:user, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
-
- describe "GET show" do
- context "when viewing a user avatar" do
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- context "when the user is blocked" do
- before do
- user.block
- end
-
- it "redirects to the sign in page" do
- get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when the user isn't blocked" do
- it "responds with status 200" do
- get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when not signed in" do
- it "responds with status 200" do
- get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when viewing a project avatar" do
- let!(:project) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
-
- context "when the project is public" do
- before do
- project.update_attribute(:visibility_level, Project::PUBLIC)
- end
-
- context "when not signed in" do
- it "responds with status 200" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- it "responds with status 200" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the project is private" do
- before do
- project.update_attribute(:visibility_level, Project::PRIVATE)
- end
-
- context "when not signed in" do
- it "redirects to the sign in page" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- context "when the user has access to the project" do
- before do
- project.team << [user, :master]
- end
-
- context "when the user is blocked" do
- before do
- user.block
- project.team << [user, :master]
- end
-
- it "redirects to the sign in page" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when the user isn't blocked" do
- it "responds with status 200" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the user doesn't have access to the project" do
- it "responds with status 404" do
- get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
-
- expect(response.status).to eq(404)
- end
- end
- end
- end
- end
-
- context "when viewing a group avatar" do
- let!(:group) { create(:group, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
- let!(:project) { create(:project, namespace: group) }
-
- context "when the group has public projects" do
- before do
- project.update_attribute(:visibility_level, Project::PUBLIC)
- end
-
- context "when not signed in" do
- it "responds with status 200" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- it "responds with status 200" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the project doesn't have public projects" do
- context "when not signed in" do
- it "redirects to the sign in page" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- context "when the user has access to the project" do
- before do
- project.team << [user, :master]
- end
-
- context "when the user is blocked" do
- before do
- user.block
- project.team << [user, :master]
- end
-
- it "redirects to the sign in page" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when the user isn't blocked" do
- it "responds with status 200" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the user doesn't have access to the project" do
- it "responds with status 404" do
- get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
-
- expect(response.status).to eq(404)
- end
- end
- end
- end
- end
-
- context "when viewing a note attachment" do
- let!(:note) { create(:note, :with_attachment) }
- let(:project) { note.project }
-
- context "when the project is public" do
- before do
- project.update_attribute(:visibility_level, Project::PUBLIC)
- end
-
- context "when not signed in" do
- it "responds with status 200" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- it "responds with status 200" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the project is private" do
- before do
- project.update_attribute(:visibility_level, Project::PRIVATE)
- end
-
- context "when not signed in" do
- it "redirects to the sign in page" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when signed in" do
- before do
- sign_in(user)
- end
-
- context "when the user has access to the project" do
- before do
- project.team << [user, :master]
- end
-
- context "when the user is blocked" do
- before do
- user.block
- project.team << [user, :master]
- end
-
- it "redirects to the sign in page" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- context "when the user isn't blocked" do
- it "responds with status 200" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response.status).to eq(200)
- end
- end
- end
-
- context "when the user doesn't have access to the project" do
- it "responds with status 404" do
- get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
-
- expect(response.status).to eq(404)
- end
- end
- end
- end
- end
- end
-end
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
deleted file mode 100644
index d47a37914df78f8135fe66c08d92d61667e3587e..0000000000000000000000000000000000000000
--- a/spec/controllers/users_controller_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'spec_helper'
-
-describe UsersController do
- let(:user) { create(:user, username: 'user1', name: 'User 1', email: 'user1@gitlab.com') }
-
- before do
- sign_in(user)
- end
-
- describe 'GET #show' do
- render_views
-
- it 'renders the show template' do
- get :show, username: user.username
- expect(response.status).to eq(200)
- expect(response).to render_template('show')
- end
- end
-
- describe 'GET #calendar' do
- it 'renders calendar' do
- get :calendar, username: user.username
- expect(response).to render_template('calendar')
- end
- end
-
- describe 'GET #calendar_activities' do
- let!(:project) { create(:project) }
- let!(:user) { create(:user) }
-
- before do
- allow_any_instance_of(User).to receive(:contributed_projects_ids).and_return([project.id])
- project.team << [user, :developer]
- end
-
- it 'assigns @calendar_date' do
- get :calendar_activities, username: user.username, date: '2014-07-31'
- expect(assigns(:calendar_date)).to eq(Date.parse('2014-07-31'))
- end
-
- it 'renders calendar_activities' do
- get :calendar_activities, username: user.username
- expect(response).to render_template('calendar_activities')
- end
- end
-end
diff --git a/spec/factories.rb b/spec/factories.rb
deleted file mode 100644
index a5c335c82bc4a1917d9e37f08247304607a8163c..0000000000000000000000000000000000000000
--- a/spec/factories.rb
+++ /dev/null
@@ -1,193 +0,0 @@
-include ActionDispatch::TestProcess
-
-FactoryGirl.define do
- sequence :sentence, aliases: [:title, :content] do
- Faker::Lorem.sentence
- end
-
- sequence :name do
- Faker::Name.name
- end
-
- sequence :file_name do
- Faker::Internet.user_name
- end
-
- sequence(:url) { Faker::Internet.uri('http') }
-
- factory :user, aliases: [:author, :assignee, :owner, :creator] do
- email { Faker::Internet.email }
- name
- sequence(:username) { |n| "#{Faker::Internet.user_name}#{n}" }
- password "12345678"
- confirmed_at { Time.now }
- confirmation_token { nil }
-
- trait :admin do
- admin true
- end
-
- factory :omniauth_user do
- ignore do
- extern_uid '123456'
- provider 'ldapmain'
- end
-
- after(:create) do |user, evaluator|
- user.identities << create(:identity,
- provider: evaluator.provider,
- extern_uid: evaluator.extern_uid
- )
- end
- end
-
- factory :admin, traits: [:admin]
- end
-
- factory :group do
- sequence(:name) { |n| "group#{n}" }
- path { name.downcase.gsub(/\s/, '_') }
- type 'Group'
- end
-
- factory :namespace do
- sequence(:name) { |n| "namespace#{n}" }
- path { name.downcase.gsub(/\s/, '_') }
- owner
- end
-
- factory :project_member do
- user
- project
- access_level { ProjectMember::MASTER }
- end
-
- factory :issue do
- title
- author
- project
-
- trait :closed do
- state :closed
- end
-
- trait :reopened do
- state :reopened
- end
-
- factory :closed_issue, traits: [:closed]
- factory :reopened_issue, traits: [:reopened]
- end
-
- factory :event do
- factory :closed_issue_event do
- project
- action { Event::CLOSED }
- target factory: :closed_issue
- author factory: :user
- end
- end
-
- factory :key do
- title
- key do
- "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
- end
-
- factory :deploy_key, class: 'DeployKey' do
- end
-
- factory :personal_key do
- user
- end
-
- factory :another_key do
- key do
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmTillFzNTrrGgwaCKaSj+QCz81E6jBc/s9av0+3b1Hwfxgkqjl4nAK/OD2NjgyrONDTDfR8cRN4eAAy6nY8GLkOyYBDyuc5nTMqs5z3yVuTwf3koGm/YQQCmo91psZ2BgDFTor8SVEE5Mm1D1k3JDMhDFxzzrOtRYFPci9lskTJaBjpqWZ4E9rDTD2q/QZntCqbC3wE9uSemRQB5f8kik7vD/AD8VQXuzKladrZKkzkONCPWsXDspUitjM8HkQdOf0PsYn1CMUC1xKYbCxkg5TkEosIwGv6CoEArUrdu/4+10LVslq494mAvEItywzrluCLCnwELfW+h/m8UHoVhZ"
- end
-
- factory :another_deploy_key, class: 'DeployKey' do
- end
- end
- end
-
- factory :email do
- user
- email do
- Faker::Internet.email('alias')
- end
-
- factory :another_email do
- email do
- Faker::Internet.email('another.alias')
- end
- end
- end
-
- factory :milestone do
- title
- project
-
- trait :closed do
- state :closed
- end
-
- factory :closed_milestone, traits: [:closed]
- end
-
- factory :system_hook do
- url
- end
-
- factory :project_hook do
- url
- end
-
- factory :project_snippet do
- project
- author
- title
- content
- file_name
- end
-
- factory :personal_snippet do
- author
- title
- content
- file_name
- end
-
- factory :snippet do
- author
- title
- content
- file_name
- end
-
- factory :protected_branch do
- name
- project
- end
-
- factory :service do
- type ""
- title "GitLab CI"
- project
- end
-
- factory :service_hook do
- url
- service
- end
-
- factory :deploy_keys_project do
- deploy_key
- project
- end
-
- factory :identity do
- provider 'ldapmain'
- extern_uid 'my-ldap-id'
- end
-end
diff --git a/spec/factories/broadcast_messages.rb b/spec/factories/broadcast_messages.rb
deleted file mode 100644
index ea0039d39e67e1d4cf53c213a417a88869a03f27..0000000000000000000000000000000000000000
--- a/spec/factories/broadcast_messages.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# == Schema Information
-#
-# Table name: broadcast_messages
-#
-# id :integer not null, primary key
-# message :text not null
-# starts_at :datetime
-# ends_at :datetime
-# alert_type :integer
-# created_at :datetime
-# updated_at :datetime
-# color :string(255)
-# font :string(255)
-#
-
-# Read about factories at https://github.com/thoughtbot/factory_girl
-
-FactoryGirl.define do
- factory :broadcast_message do
- message "MyText"
- starts_at "2013-11-12 13:43:25"
- ends_at "2013-11-12 13:43:25"
- alert_type 1
- color "#555555"
- font "#BBBBBB"
- end
-end
diff --git a/spec/factories/forked_project_links.rb b/spec/factories/forked_project_links.rb
deleted file mode 100644
index 906e4106b320750b1c7d9be608bf4b6fd72be0b1..0000000000000000000000000000000000000000
--- a/spec/factories/forked_project_links.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# == Schema Information
-#
-# Table name: forked_project_links
-#
-# id :integer not null, primary key
-# forked_to_project_id :integer not null
-# forked_from_project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-#
-
-# Read about factories at https://github.com/thoughtbot/factory_girl
-
-FactoryGirl.define do
- factory :forked_project_link do
- association :forked_to_project, factory: :project
- association :forked_from_project, factory: :project
- end
-end
diff --git a/spec/factories/group_members.rb b/spec/factories/group_members.rb
deleted file mode 100644
index debb86d997f48773b6a323ea08d9228e6f80f883..0000000000000000000000000000000000000000
--- a/spec/factories/group_members.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# == Schema Information
-#
-# Table name: group_members
-#
-# id :integer not null, primary key
-# group_access :integer not null
-# group_id :integer not null
-# user_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-# notification_level :integer default(3), not null
-#
-
-FactoryGirl.define do
- factory :group_member do
- access_level { GroupMember::OWNER }
- group
- user
- end
-end
diff --git a/spec/factories/label_links.rb b/spec/factories/label_links.rb
deleted file mode 100644
index bd304b5db6b5214f282e50ff8def59963ce6a212..0000000000000000000000000000000000000000
--- a/spec/factories/label_links.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# == Schema Information
-#
-# Table name: label_links
-#
-# id :integer not null, primary key
-# label_id :integer
-# target_id :integer
-# target_type :string(255)
-# created_at :datetime
-# updated_at :datetime
-#
-
-# Read about factories at https://github.com/thoughtbot/factory_girl
-
-FactoryGirl.define do
- factory :label_link do
- label
- target factory: :issue
- end
-end
diff --git a/spec/factories/labels.rb b/spec/factories/labels.rb
deleted file mode 100644
index 6829387c660c86490e08d806fe90f315a8ee29f1..0000000000000000000000000000000000000000
--- a/spec/factories/labels.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# == Schema Information
-#
-# Table name: labels
-#
-# id :integer not null, primary key
-# title :string(255)
-# color :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-#
-
-# Read about factories at https://github.com/thoughtbot/factory_girl
-
-FactoryGirl.define do
- factory :label do
- title "Bug"
- color "#990000"
- project
- end
-end
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb
deleted file mode 100644
index 77cd37c22d93c0c85d7cf2fcfacca2d392396667..0000000000000000000000000000000000000000
--- a/spec/factories/merge_requests.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# == Schema Information
-#
-# Table name: merge_requests
-#
-# id :integer not null, primary key
-# target_branch :string(255) not null
-# source_branch :string(255) not null
-# source_project_id :integer not null
-# author_id :integer
-# assignee_id :integer
-# title :string(255)
-# created_at :datetime
-# updated_at :datetime
-# milestone_id :integer
-# state :string(255)
-# merge_status :string(255)
-# target_project_id :integer not null
-# iid :integer
-# description :text
-# position :integer default(0)
-# locked_at :datetime
-#
-
-FactoryGirl.define do
- factory :merge_request do
- title
- author
- source_project factory: :project
- target_project { source_project }
-
- # → git log --pretty=oneline feature..master
- # 5937ac0a7beb003549fc5fd26fc247adbce4a52e Add submodule from gitlab.com
- # 570e7b2abdd848b95f2f578043fc23bd6f6fd24d Change some files
- # 6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 More submodules
- # d14d6c0abdd253381df51a723d58691b2ee1ab08 Remove ds_store files
- # c1acaa58bbcbc3eafe538cb8274ba387047b69f8 Ignore DS files
- #
- # See also RepoHelpers.sample_compare
- #
- source_branch "master"
- target_branch "feature"
-
- merge_status "can_be_merged"
-
- trait :with_diffs do
- end
-
- trait :conflict do
- source_branch "feature_conflict"
- target_branch "feature"
- end
-
- trait :closed do
- state :closed
- end
-
- trait :reopened do
- state :reopened
- end
-
- trait :simple do
- source_branch "feature"
- target_branch "master"
- end
-
- factory :closed_merge_request, traits: [:closed]
- factory :reopened_merge_request, traits: [:reopened]
- factory :merge_request_with_diffs, traits: [:with_diffs]
- end
-end
diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb
deleted file mode 100644
index f1c33461b55ee93bc294c4be19ed93f0154c49ef..0000000000000000000000000000000000000000
--- a/spec/factories/notes.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# == Schema Information
-#
-# Table name: notes
-#
-# id :integer not null, primary key
-# note :text
-# noteable_type :string(255)
-# author_id :integer
-# created_at :datetime
-# updated_at :datetime
-# project_id :integer
-# attachment :string(255)
-# line_code :string(255)
-# commit_id :string(255)
-# noteable_id :integer
-# system :boolean default(FALSE), not null
-# st_diff :text
-#
-
-require_relative '../support/repo_helpers'
-
-FactoryGirl.define do
- factory :note do
- project
- note "Note"
- author
-
- factory :note_on_commit, traits: [:on_commit]
- factory :note_on_commit_diff, traits: [:on_commit, :on_diff]
- factory :note_on_issue, traits: [:on_issue], aliases: [:votable_note]
- factory :note_on_merge_request, traits: [:on_merge_request]
- factory :note_on_merge_request_diff, traits: [:on_merge_request, :on_diff]
- factory :note_on_project_snippet, traits: [:on_project_snippet]
-
- trait :on_commit do
- project factory: :project
- commit_id RepoHelpers.sample_commit.id
- noteable_type "Commit"
- end
-
- trait :on_diff do
- line_code "0_184_184"
- end
-
- trait :on_merge_request do
- project factory: :project
- noteable_id 1
- noteable_type "MergeRequest"
- end
-
- trait :on_issue do
- noteable_id 1
- noteable_type "Issue"
- end
-
- trait :on_project_snippet do
- noteable_id 1
- noteable_type "Snippet"
- end
-
- trait :with_attachment do
- attachment { fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "`/png") }
- end
- end
-end
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
deleted file mode 100644
index 0899a7603fcec5b2ffef6c0358e588268298700e..0000000000000000000000000000000000000000
--- a/spec/factories/projects.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-# == Schema Information
-#
-# Table name: projects
-#
-# id :integer not null, primary key
-# name :string(255)
-# path :string(255)
-# description :text
-# created_at :datetime
-# updated_at :datetime
-# creator_id :integer
-# issues_enabled :boolean default(TRUE), not null
-# wall_enabled :boolean default(TRUE), not null
-# merge_requests_enabled :boolean default(TRUE), not null
-# wiki_enabled :boolean default(TRUE), not null
-# namespace_id :integer
-# issues_tracker :string(255) default("gitlab"), not null
-# issues_tracker_id :string(255)
-# snippets_enabled :boolean default(TRUE), not null
-# last_activity_at :datetime
-# import_url :string(255)
-# visibility_level :integer default(0), not null
-# archived :boolean default(FALSE), not null
-# import_status :string(255)
-# repository_size :float default(0.0)
-# star_count :integer default(0), not null
-# import_type :string(255)
-# import_source :string(255)
-# avatar :string(255)
-#
-
-FactoryGirl.define do
- # Project without repository
- #
- # Project does not have bare repository.
- # Use this factory if you dont need repository in tests
- factory :empty_project, class: 'Project' do
- sequence(:name) { |n| "project#{n}" }
- path { name.downcase.gsub(/\s/, '_') }
- namespace
- creator
- snippets_enabled true
-
- trait :public do
- visibility_level Gitlab::VisibilityLevel::PUBLIC
- end
-
- trait :internal do
- visibility_level Gitlab::VisibilityLevel::INTERNAL
- end
-
- trait :private do
- visibility_level Gitlab::VisibilityLevel::PRIVATE
- end
- end
-
- # Project with empty repository
- #
- # This is a case when you just created a project
- # but not pushed any code there yet
- factory :project_empty_repo, parent: :empty_project do
- after :create do |project|
- project.create_repository
- end
- end
-
- # Project with test repository
- #
- # Test repository source can be found at
- # https://gitlab.com/gitlab-org/gitlab-test
- factory :project, parent: :empty_project do
- path { 'gitlabhq' }
-
- after :create do |project|
- TestEnv.copy_repo(project)
- end
- end
-
- factory :redmine_project, parent: :project do
- after :create do |project|
- project.create_redmine_service(
- active: true,
- properties: {
- 'project_url' => 'http://redmine/projects/project_name_in_redmine',
- 'issues_url' => "http://redmine/#{project.id}/project_name_in_redmine/:id",
- 'new_issue_url' => 'http://redmine/projects/project_name_in_redmine/issues/new'
- }
- )
- end
- after :create do |project|
- project.issues_tracker = 'redmine'
- project.issues_tracker_id = 'project_name_in_redmine'
- end
- end
-end
diff --git a/spec/factories_spec.rb b/spec/factories_spec.rb
deleted file mode 100644
index 457859dedaf863931fa5e07ab5e1c029f118c591..0000000000000000000000000000000000000000
--- a/spec/factories_spec.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'spec_helper'
-
-FactoryGirl.factories.map(&:name).each do |factory_name|
- describe "#{factory_name} factory" do
- it 'should be valid' do
- expect(build(factory_name)).to be_valid
- end
- end
-end
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
deleted file mode 100644
index 25862614d2849e734a96ee8ef00e376fbe436763..0000000000000000000000000000000000000000
--- a/spec/features/admin/admin_hooks_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe "Admin::Hooks", feature: true do
- before do
- @project = create(:project)
- login_as :admin
-
- @system_hook = create(:system_hook)
-
- end
-
- describe "GET /admin/hooks" do
- it "should be ok" do
- visit admin_root_path
- within ".sidebar-wrapper" do
- click_on "Hooks"
- end
- expect(current_path).to eq(admin_hooks_path)
- end
-
- it "should have hooks list" do
- visit admin_hooks_path
- expect(page).to have_content(@system_hook.url)
- end
- end
-
- describe "New Hook" do
- before do
- @url = Faker::Internet.uri("http")
- visit admin_hooks_path
- fill_in "hook_url", with: @url
- expect { click_button "Add System Hook" }.to change(SystemHook, :count).by(1)
- end
-
- it "should open new hook popup" do
- expect(current_path).to eq(admin_hooks_path)
- expect(page).to have_content(@url)
- end
- end
-
- describe "Test" do
- before do
- WebMock.stub_request(:post, @system_hook.url)
- visit admin_hooks_path
- click_link "Test Hook"
- end
-
- it { expect(current_path).to eq(admin_hooks_path) }
- end
-
-end
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb
deleted file mode 100644
index 101d955d693c74d1ee29497fa0df828b03c37560..0000000000000000000000000000000000000000
--- a/spec/features/admin/admin_projects_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'spec_helper'
-
-describe "Admin::Projects", feature: true do
- before do
- @project = create(:project)
- login_as :admin
- end
-
- describe "GET /admin/projects" do
- before do
- visit admin_namespaces_projects_path
- end
-
- it "should be ok" do
- expect(current_path).to eq(admin_namespaces_projects_path)
- end
-
- it "should have projects list" do
- expect(page).to have_content(@project.name)
- end
- end
-
- describe "GET /admin/projects/:id" do
- before do
- visit admin_namespaces_projects_path
- click_link "#{@project.name}"
- end
-
- it "should have project info" do
- expect(page).to have_content(@project.path)
- expect(page).to have_content(@project.name)
- end
- end
-end
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
deleted file mode 100644
index f97b69713ceca6862bacafa3729342fa99a6fc78..0000000000000000000000000000000000000000
--- a/spec/features/admin/admin_users_spec.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require 'spec_helper'
-
-describe "Admin::Users", feature: true do
- before { login_as :admin }
-
- describe "GET /admin/users" do
- before do
- visit admin_users_path
- end
-
- it "should be ok" do
- expect(current_path).to eq(admin_users_path)
- end
-
- it "should have users list" do
- expect(page).to have_content(@user.email)
- expect(page).to have_content(@user.name)
- end
- end
-
- describe "GET /admin/users/new" do
- before do
- visit new_admin_user_path
- fill_in "user_name", with: "Big Bang"
- fill_in "user_username", with: "bang"
- fill_in "user_email", with: "bigbang@mail.com"
- end
-
- it "should create new user" do
- expect { click_button "Create user" }.to change {User.count}.by(1)
- end
-
- it "should apply defaults to user" do
- click_button "Create user"
- user = User.find_by(username: 'bang')
- expect(user.projects_limit).
- to eq(Gitlab.config.gitlab.default_projects_limit)
- expect(user.can_create_group).
- to eq(Gitlab.config.gitlab.default_can_create_group)
- end
-
- it "should create user with valid data" do
- click_button "Create user"
- user = User.find_by(username: 'bang')
- expect(user.name).to eq('Big Bang')
- expect(user.email).to eq('bigbang@mail.com')
- end
-
- it "should call send mail" do
- expect(Notify).to receive(:new_user_email)
-
- click_button "Create user"
- end
-
- it "should send valid email to user with email & password" do
- click_button "Create user"
- user = User.find_by(username: 'bang')
- email = ActionMailer::Base.deliveries.last
- expect(email.subject).to have_content('Account was created')
- expect(email.text_part.body).to have_content(user.email)
- expect(email.text_part.body).to have_content('password')
- end
- end
-
- describe "GET /admin/users/:id" do
- before do
- visit admin_users_path
- click_link "#{@user.name}"
- end
-
- it "should have user info" do
- expect(page).to have_content(@user.email)
- expect(page).to have_content(@user.name)
- end
- end
-
- describe "GET /admin/users/:id/edit" do
- before do
- @simple_user = create(:user)
- visit admin_users_path
- click_link "edit_user_#{@simple_user.id}"
- end
-
- it "should have user edit page" do
- expect(page).to have_content('Name')
- expect(page).to have_content('Password')
- end
-
- describe "Update user" do
- before do
- fill_in "user_name", with: "Big Bang"
- fill_in "user_email", with: "bigbang@mail.com"
- check "user_admin"
- click_button "Save changes"
- end
-
- it "should show page with new data" do
- expect(page).to have_content('bigbang@mail.com')
- expect(page).to have_content('Big Bang')
- end
-
- it "should change user entry" do
- @simple_user.reload
- expect(@simple_user.name).to eq('Big Bang')
- expect(@simple_user.is_admin?).to be_truthy
- end
- end
- end
-end
diff --git a/spec/features/admin/security_spec.rb b/spec/features/admin/security_spec.rb
deleted file mode 100644
index 175fa9d4647fea1de2cbf57b327d7113efef3cc3..0000000000000000000000000000000000000000
--- a/spec/features/admin/security_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe "Admin::Projects", feature: true do
- describe "GET /admin/projects" do
- subject { admin_namespaces_projects_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /admin/users" do
- subject { admin_users_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /admin/hooks" do
- subject { admin_hooks_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb
deleted file mode 100644
index b710cb3c72ff33b85d85de20b73bb0d9e954e48f..0000000000000000000000000000000000000000
--- a/spec/features/atom/dashboard_issues_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'spec_helper'
-
-describe "Dashboard Issues Feed", feature: true do
- describe "GET /issues" do
- let!(:user) { create(:user) }
- let!(:project1) { create(:project) }
- let!(:project2) { create(:project) }
- let!(:issue1) { create(:issue, author: user, assignee: user, project: project1) }
- let!(:issue2) { create(:issue, author: user, assignee: user, project: project2) }
-
- before do
- project1.team << [user, :master]
- project2.team << [user, :master]
- end
-
- describe "atom feed" do
- it "should render atom feed via private token" do
- visit issues_dashboard_path(:atom, private_token: user.private_token)
-
- expect(response_headers['Content-Type']).
- to have_content('application/atom+xml')
- expect(body).to have_selector('title', text: "#{user.name} issues")
- expect(body).to have_selector('author email', text: issue1.author_email)
- expect(body).to have_selector('entry summary', text: issue1.title)
- expect(body).to have_selector('author email', text: issue2.author_email)
- expect(body).to have_selector('entry summary', text: issue2.title)
- end
- end
- end
-end
diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb
deleted file mode 100644
index ad157d742ff42f4d1fca3453f83daec6eb0cbbbb..0000000000000000000000000000000000000000
--- a/spec/features/atom/dashboard_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-
-describe "Dashboard Feed", feature: true do
- describe "GET /" do
- let!(:user) { create(:user, name: "Jonh") }
-
- context "projects atom feed via private token" do
- it "should render projects atom feed" do
- visit dashboard_path(:atom, private_token: user.private_token)
- expect(body).to have_selector('feed title')
- end
- end
-
- context 'feed content' do
- let(:project) { create(:project) }
- let(:issue) { create(:issue, project: project, author: user, description: '') }
- let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
-
- before do
- project.team << [user, :master]
- issue_event(issue, user)
- note_event(note, user)
- visit dashboard_path(:atom, private_token: user.private_token)
- end
-
- it "should have issue opened event" do
- expect(body).to have_content("#{user.name} opened issue ##{issue.iid}")
- end
-
- it "should have issue comment event" do
- expect(body).
- to have_content("#{user.name} commented on issue ##{issue.iid}")
- end
- end
- end
-
- def issue_event(issue, user)
- EventCreateService.new.open_issue(issue, user)
- end
-
- def note_event(note, user)
- EventCreateService.new.leave_note(note, user)
- end
-end
diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb
deleted file mode 100644
index baa7814e96a017ab5cc74ae3c5a5e12586f14ab3..0000000000000000000000000000000000000000
--- a/spec/features/atom/issues_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-
-describe 'Issues Feed', feature: true do
- describe 'GET /issues' do
- let!(:user) { create(:user) }
- let!(:project) { create(:project) }
- let!(:issue) { create(:issue, author: user, project: project) }
-
- before { project.team << [user, :developer] }
-
- context 'when authenticated' do
- it 'should render atom feed' do
- login_with user
- visit namespace_project_issues_path(project.namespace, project, :atom)
-
- expect(response_headers['Content-Type']).
- to have_content('application/atom+xml')
- expect(body).to have_selector('title', text: "#{project.name} issues")
- expect(body).to have_selector('author email', text: issue.author_email)
- expect(body).to have_selector('entry summary', text: issue.title)
- end
- end
-
- context 'when authenticated via private token' do
- it 'should render atom feed' do
- visit namespace_project_issues_path(project.namespace, project, :atom,
- private_token: user.private_token)
-
- expect(response_headers['Content-Type']).
- to have_content('application/atom+xml')
- expect(body).to have_selector('title', text: "#{project.name} issues")
- expect(body).to have_selector('author email', text: issue.author_email)
- expect(body).to have_selector('entry summary', text: issue.title)
- end
- end
- end
-end
diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb
deleted file mode 100644
index 770ac04c2c57f49b68bb9d93e99d3bb41d253a5d..0000000000000000000000000000000000000000
--- a/spec/features/atom/users_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require 'spec_helper'
-
-describe "User Feed", feature: true do
- describe "GET /" do
- let!(:user) { create(:user) }
-
- context 'user atom feed via private token' do
- it "should render user atom feed" do
- visit user_path(user, :atom, private_token: user.private_token)
- expect(body).to have_selector('feed title')
- end
- end
-
- context 'feed content' do
- let(:project) { create(:project) }
- let(:issue) do
- create(:issue, project: project,
- author: user, description: "Houston, we have a bug!\n\n***\n\nI guess.")
- end
- let(:note) do
- create(:note, noteable: issue, author: user,
- note: 'Bug confirmed :+1:', project: project)
- end
- let(:merge_request) do
- create(:merge_request,
- title: 'Fix bug', author: user,
- source_project: project, target_project: project,
- description: "Here is the fix: ")
- end
-
- before do
- project.team << [user, :master]
- issue_event(issue, user)
- note_event(note, user)
- merge_request_event(merge_request, user)
- visit user_path(user, :atom, private_token: user.private_token)
- end
-
- it 'should have issue opened event' do
- expect(body).to have_content("#{safe_name} opened issue ##{issue.iid}")
- end
-
- it 'should have issue comment event' do
- expect(body).
- to have_content("#{safe_name} commented on issue ##{issue.iid}")
- end
-
- it 'should have XHTML summaries in issue descriptions' do
- expect(body).to match /we have a bug!<\/p>\n\n
\n\n]*\/>/
- end
-
- it 'should have XHTML summaries in merge request descriptions' do
- expect(body).to match /Here is the fix:
]*\/>/
- end
- end
- end
-
- def issue_event(issue, user)
- EventCreateService.new.open_issue(issue, user)
- end
-
- def note_event(note, user)
- EventCreateService.new.leave_note(note, user)
- end
-
- def merge_request_event(request, user)
- EventCreateService.new.open_mr(request, user)
- end
-
- def safe_name
- html_escape(user.name)
- end
-end
diff --git a/spec/features/gitlab_flavored_markdown_spec.rb b/spec/features/gitlab_flavored_markdown_spec.rb
deleted file mode 100644
index fca1a06eb88d3d0ec2dd397a5e95cf9aec723ef6..0000000000000000000000000000000000000000
--- a/spec/features/gitlab_flavored_markdown_spec.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'spec_helper'
-
-describe "GitLab Flavored Markdown", feature: true do
- let(:project) { create(:project) }
- let(:issue) { create(:issue, project: project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:fred) do
- u = create(:user, name: "fred")
- project.team << [u, :master]
- u
- end
-
- before do
- Commit.any_instance.stub(title: "fix ##{issue.iid}\n\nask @#{fred.username} for details")
- end
-
- let(:commit) { project.repository.commit }
-
- before do
- login_as :user
- project.team << [@user, :developer]
- end
-
- describe "for commits" do
- it "should render title in commits#index" do
- visit namespace_project_commits_path(project.namespace, project, 'master', limit: 1)
-
- expect(page).to have_link("##{issue.iid}")
- end
-
- it "should render title in commits#show" do
- visit namespace_project_commit_path(project.namespace, project, commit)
-
- expect(page).to have_link("##{issue.iid}")
- end
-
- it "should render description in commits#show" do
- visit namespace_project_commit_path(project.namespace, project, commit)
-
- expect(page).to have_link("@#{fred.username}")
- end
-
- it "should render title in repositories#branches" do
- visit namespace_project_branches_path(project.namespace, project)
-
- expect(page).to have_link("##{issue.iid}")
- end
- end
-
- describe "for issues" do
- before do
- @other_issue = create(:issue,
- author: @user,
- assignee: @user,
- project: project)
- @issue = create(:issue,
- author: @user,
- assignee: @user,
- project: project,
- title: "fix ##{@other_issue.iid}",
- description: "ask @#{fred.username} for details")
- end
-
- it "should render subject in issues#index" do
- visit namespace_project_issues_path(project.namespace, project)
-
- expect(page).to have_link("##{@other_issue.iid}")
- end
-
- it "should render subject in issues#show" do
- visit namespace_project_issue_path(project.namespace, project, @issue)
-
- expect(page).to have_link("##{@other_issue.iid}")
- end
-
- it "should render details in issues#show" do
- visit namespace_project_issue_path(project.namespace, project, @issue)
-
- expect(page).to have_link("@#{fred.username}")
- end
- end
-
-
- describe "for merge requests" do
- before do
- @merge_request = create(:merge_request, source_project: project, target_project: project, title: "fix ##{issue.iid}")
- end
-
- it "should render title in merge_requests#index" do
- visit namespace_project_merge_requests_path(project.namespace, project)
-
- expect(page).to have_link("##{issue.iid}")
- end
-
- it "should render title in merge_requests#show" do
- visit namespace_project_merge_request_path(project.namespace, project, @merge_request)
-
- expect(page).to have_link("##{issue.iid}")
- end
- end
-
-
- describe "for milestones" do
- before do
- @milestone = create(:milestone,
- project: project,
- title: "fix ##{issue.iid}",
- description: "ask @#{fred.username} for details")
- end
-
- it "should render title in milestones#index" do
- visit namespace_project_milestones_path(project.namespace, project)
-
- expect(page).to have_link("##{issue.iid}")
- end
-
- it "should render title in milestones#show" do
- visit namespace_project_milestone_path(project.namespace, project, @milestone)
-
- expect(page).to have_link("##{issue.iid}")
- end
-
- it "should render description in milestones#show" do
- visit namespace_project_milestone_path(project.namespace, project, @milestone)
-
- expect(page).to have_link("@#{fred.username}")
- end
- end
-end
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
deleted file mode 100644
index e5f33d5a25acba8971b86f6cdbe7240875a43898..0000000000000000000000000000000000000000
--- a/spec/features/issues_spec.rb
+++ /dev/null
@@ -1,320 +0,0 @@
-require 'spec_helper'
-
-describe 'Issues', feature: true do
- include SortingHelper
-
- let(:project) { create(:project) }
-
- before do
- login_as :user
- user2 = create(:user)
-
- project.team << [[@user, user2], :developer]
- end
-
- describe 'Edit issue' do
- let!(:issue) do
- create(:issue,
- author: @user,
- assignee: @user,
- project: project)
- end
-
- before do
- visit namespace_project_issues_path(project.namespace, project)
- click_link "Edit"
- end
-
- it 'should open new issue popup' do
- expect(page).to have_content("Issue ##{issue.iid}")
- end
-
- describe 'fill in' do
- before do
- fill_in 'issue_title', with: 'bug 345'
- fill_in 'issue_description', with: 'bug description'
- end
-
- it 'does not change issue count' do
- expect {
- click_button 'Save changes'
- }.to_not change { Issue.count }
- end
-
- it 'should update issue fields' do
- click_button 'Save changes'
-
- expect(page).to have_content @user.name
- expect(page).to have_content 'bug 345'
- expect(page).to have_content project.name
- end
- end
-
- end
-
- describe 'Editing issue assignee' do
- let!(:issue) do
- create(:issue,
- author: @user,
- assignee: @user,
- project: project)
- end
-
- it 'allows user to select unasigned', js: true do
- visit edit_namespace_project_issue_path(project.namespace, project, issue)
-
- expect(page).to have_content "Assign to #{@user.name}"
-
- first('#s2id_issue_assignee_id').click
- sleep 2 # wait for ajax stuff to complete
- first('.user-result').click
-
- click_button 'Save changes'
-
- expect(page).to have_content 'Assignee: none'
- expect(issue.reload.assignee).to be_nil
- end
- end
-
- describe 'Filter issue' do
- before do
- ['foobar', 'barbaz', 'gitlab'].each do |title|
- create(:issue,
- author: @user,
- assignee: @user,
- project: project,
- title: title)
- end
-
- @issue = Issue.find_by(title: 'foobar')
- @issue.milestone = create(:milestone, project: project)
- @issue.assignee = nil
- @issue.save
- end
-
- let(:issue) { @issue }
-
- it 'should allow filtering by issues with no specified milestone' do
- visit namespace_project_issues_path(project.namespace, project, milestone_id: IssuableFinder::NONE)
-
- expect(page).not_to have_content 'foobar'
- expect(page).to have_content 'barbaz'
- expect(page).to have_content 'gitlab'
- end
-
- it 'should allow filtering by a specified milestone' do
- visit namespace_project_issues_path(project.namespace, project, milestone_id: issue.milestone.id)
-
- expect(page).to have_content 'foobar'
- expect(page).not_to have_content 'barbaz'
- expect(page).not_to have_content 'gitlab'
- end
-
- it 'should allow filtering by issues with no specified assignee' do
- visit namespace_project_issues_path(project.namespace, project, assignee_id: IssuableFinder::NONE)
-
- expect(page).to have_content 'foobar'
- expect(page).not_to have_content 'barbaz'
- expect(page).not_to have_content 'gitlab'
- end
-
- it 'should allow filtering by a specified assignee' do
- visit namespace_project_issues_path(project.namespace, project, assignee_id: @user.id)
-
- expect(page).not_to have_content 'foobar'
- expect(page).to have_content 'barbaz'
- expect(page).to have_content 'gitlab'
- end
- end
-
- describe 'filter issue' do
- titles = ['foo','bar','baz']
- titles.each_with_index do |title, index|
- let!(title.to_sym) do
- create(:issue, title: title,
- project: project,
- created_at: Time.now - (index * 60))
- end
- end
- let(:newer_due_milestone) { create(:milestone, due_date: '2013-12-11') }
- let(:later_due_milestone) { create(:milestone, due_date: '2013-12-12') }
-
- it 'sorts by newest' do
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_recently_created)
-
- expect(first_issue).to include('foo')
- expect(last_issue).to include('baz')
- end
-
- it 'sorts by oldest' do
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_oldest_created)
-
- expect(first_issue).to include('baz')
- expect(last_issue).to include('foo')
- end
-
- it 'sorts by most recently updated' do
- baz.updated_at = Time.now + 100
- baz.save
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_recently_updated)
-
- expect(first_issue).to include('baz')
- end
-
- it 'sorts by least recently updated' do
- baz.updated_at = Time.now - 100
- baz.save
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_oldest_updated)
-
- expect(first_issue).to include('baz')
- end
-
- describe 'sorting by milestone' do
- before :each do
- foo.milestone = newer_due_milestone
- foo.save
- bar.milestone = later_due_milestone
- bar.save
- end
-
- it 'sorts by recently due milestone' do
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_milestone_soon)
-
- expect(first_issue).to include('foo')
- end
-
- it 'sorts by least recently due milestone' do
- visit namespace_project_issues_path(project.namespace, project, sort: sort_value_milestone_later)
-
- expect(first_issue).to include('bar')
- end
- end
-
- describe 'combine filter and sort' do
- let(:user2) { create(:user) }
-
- before :each do
- foo.assignee = user2
- foo.save
- bar.assignee = user2
- bar.save
- end
-
- it 'sorts with a filter applied' do
- visit namespace_project_issues_path(project.namespace, project,
- sort: sort_value_oldest_created,
- assignee_id: user2.id)
-
- expect(first_issue).to include('bar')
- expect(last_issue).to include('foo')
- expect(page).not_to have_content 'baz'
- end
- end
- end
-
- describe 'update assignee from issue#show' do
- let(:issue) { create(:issue, project: project, author: @user) }
-
- context 'by autorized user' do
-
- it 'with dropdown menu' do
- visit namespace_project_issue_path(project.namespace, project, issue)
-
- find('.edit-issue.inline-update #issue_assignee_id').
- set project.team.members.first.id
- click_button 'Update Issue'
-
- expect(page).to have_content 'Assignee:'
- has_select?('issue_assignee_id',
- selected: project.team.members.first.name)
- end
- end
-
- context 'by unauthorized user' do
-
- let(:guest) { create(:user) }
-
- before :each do
- project.team << [[guest], :guest]
- issue.assignee = @user
- issue.save
- end
-
- it 'shows assignee text', js: true do
- logout
- login_with guest
-
- visit namespace_project_issue_path(project.namespace, project, issue)
- expect(page).to have_content issue.assignee.name
- end
- end
- end
-
- describe 'update milestone from issue#show' do
- let!(:issue) { create(:issue, project: project, author: @user) }
- let!(:milestone) { create(:milestone, project: project) }
-
- context 'by authorized user' do
-
- it 'with dropdown menu' do
- visit namespace_project_issue_path(project.namespace, project, issue)
-
- find('.edit-issue.inline-update').
- select(milestone.title, from: 'issue_milestone_id')
- click_button 'Update Issue'
-
- expect(page).to have_content "Milestone changed to #{milestone.title}"
- expect(page).to have_content "Milestone: #{milestone.title}"
- has_select?('issue_assignee_id', selected: milestone.title)
- end
- end
-
- context 'by unauthorized user' do
- let(:guest) { create(:user) }
-
- before :each do
- project.team << [guest, :guest]
- issue.milestone = milestone
- issue.save
- end
-
- it 'shows milestone text', js: true do
- logout
- login_with guest
-
- visit namespace_project_issue_path(project.namespace, project, issue)
- expect(page).to have_content milestone.title
- end
- end
-
- describe 'removing assignee' do
- let(:user2) { create(:user) }
-
- before :each do
- issue.assignee = user2
- issue.save
- end
-
- it 'allows user to remove assignee', :js => true do
- visit namespace_project_issue_path(project.namespace, project, issue)
- expect(page).to have_content "Assignee: #{user2.name}"
-
- first('#s2id_issue_assignee_id').click
- sleep 2 # wait for ajax stuff to complete
- first('.user-result').click
-
- expect(page).to have_content 'Assignee: none'
- sleep 2 # wait for ajax stuff to complete
- expect(issue.reload.assignee).to be_nil
- end
- end
- end
-
- def first_issue
- all('ul.issues-list li').first.text
- end
-
- def last_issue
- all('ul.issues-list li').last.text
- end
-end
diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb
deleted file mode 100644
index c47368b1fdaa13ff39c3e1740a443be7a12a11ec..0000000000000000000000000000000000000000
--- a/spec/features/notes_on_merge_requests_spec.rb
+++ /dev/null
@@ -1,230 +0,0 @@
-require 'spec_helper'
-
-describe 'Comments' do
- include RepoHelpers
-
- describe 'On a merge request', js: true, feature: true do
- let!(:merge_request) { create(:merge_request) }
- let!(:project) { merge_request.source_project }
- let!(:note) do
- create(:note_on_merge_request, :with_attachment, project: project)
- end
-
- before do
- login_as :admin
- visit namespace_project_merge_request_path(project.namespace, project, merge_request)
- end
-
- subject { page }
-
- describe 'the note form' do
- it 'should be valid' do
- is_expected.to have_css('.js-main-target-form', visible: true, count: 1)
- expect(find('.js-main-target-form input[type=submit]').value).
- to eq('Add Comment')
- within('.js-main-target-form') do
- expect(page).not_to have_link('Cancel')
- end
- end
-
- describe 'with text' do
- before do
- within('.js-main-target-form') do
- fill_in 'note[note]', with: 'This is awesome'
- end
- end
-
- it 'should have enable submit button and preview button' do
- within('.js-main-target-form') do
- expect(page).not_to have_css('.js-comment-button[disabled]')
- expect(page).to have_css('.js-md-preview-button', visible: true)
- end
- end
- end
- end
-
- describe 'when posting a note' do
- before do
- within('.js-main-target-form') do
- fill_in 'note[note]', with: 'This is awsome!'
- find('.js-md-preview-button').click
- click_button 'Add Comment'
- end
- end
-
- it 'should be added and form reset' do
- is_expected.to have_content('This is awsome!')
- within('.js-main-target-form') do
- expect(page).to have_no_field('note[note]', with: 'This is awesome!')
- expect(page).to have_css('.js-md-preview', visible: :hidden)
- end
- within('.js-main-target-form') do
- is_expected.to have_css('.js-note-text', visible: true)
- end
- end
- end
-
- describe 'when editing a note', js: true do
- it 'should contain the hidden edit form' do
- within("#note_#{note.id}") do
- is_expected.to have_css('.note-edit-form', visible: false)
- end
- end
-
- describe 'editing the note' do
- before do
- find('.note').hover
- find(".js-note-edit").click
- end
-
- it 'should show the note edit form and hide the note body' do
- within("#note_#{note.id}") do
- expect(find('.current-note-edit-form', visible: true)).to be_visible
- expect(find('.note-edit-form', visible: true)).to be_visible
- expect(find(:css, '.note-body > .note-text', visible: false)).not_to be_visible
- end
- end
-
- # TODO: fix after 7.7 release
- #it "should reset the edit note form textarea with the original content of the note if cancelled" do
- #within(".current-note-edit-form") do
- #fill_in "note[note]", with: "Some new content"
- #find(".btn-cancel").click
- #find(".js-note-text", visible: false).text.should == note.note
- #end
- #end
-
- it 'appends the edited at time to the note' do
- within('.current-note-edit-form') do
- fill_in 'note[note]', with: 'Some new content'
- find('.btn-save').click
- end
-
- within("#note_#{note.id}") do
- is_expected.to have_css('.note_edited_ago')
- expect(find('.note_edited_ago').text).
- to match(/less than a minute ago/)
- end
- end
- end
-
- describe 'deleting an attachment' do
- before do
- find('.note').hover
- find('.js-note-edit').click
- end
-
- it 'shows the delete link' do
- within('.note-attachment') do
- is_expected.to have_css('.js-note-attachment-delete')
- end
- end
-
- it 'removes the attachment div and resets the edit form' do
- find('.js-note-attachment-delete').click
- is_expected.not_to have_css('.note-attachment')
- expect(find('.current-note-edit-form', visible: false)).
- not_to be_visible
- end
- end
- end
- end
-
- describe 'On a merge request diff', js: true, feature: true do
- let(:merge_request) { create(:merge_request) }
- let(:project) { merge_request.source_project }
-
- before do
- login_as :admin
- visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
- end
-
- subject { page }
-
- describe 'when adding a note' do
- before do
- click_diff_line
- end
-
- describe 'the notes holder' do
- it { is_expected.to have_css('.js-temp-notes-holder') }
-
- it 'has .new_note css class' do
- within('.js-temp-notes-holder') do
- expect(subject).to have_css('.new_note')
- end
- end
- end
-
- describe 'the note form' do
- it "shouldn't add a second form for same row" do
- click_diff_line
-
- is_expected.
- to have_css("tr[id='#{line_code}'] + .js-temp-notes-holder form",
- count: 1)
- end
-
- it 'should be removed when canceled' do
- within(".diff-file form[rel$='#{line_code}']") do
- find('.js-close-discussion-note-form').trigger('click')
- end
-
- is_expected.to have_no_css('.js-temp-notes-holder')
- end
- end
- end
-
- describe 'with muliple note forms' do
- before do
- click_diff_line
- click_diff_line(line_code_2)
- end
-
- it { is_expected.to have_css('.js-temp-notes-holder', count: 2) }
-
- describe 'previewing them separately' do
- before do
- # add two separate texts and trigger previews on both
- within("tr[id='#{line_code}'] + .js-temp-notes-holder") do
- fill_in 'note[note]', with: 'One comment on line 7'
- find('.js-md-preview-button').click
- end
- within("tr[id='#{line_code_2}'] + .js-temp-notes-holder") do
- fill_in 'note[note]', with: 'Another comment on line 10'
- find('.js-md-preview-button').click
- end
- end
- end
-
- describe 'posting a note' do
- before do
- within("tr[id='#{line_code_2}'] + .js-temp-notes-holder") do
- fill_in 'note[note]', with: 'Another comment on line 10'
- click_button('Add Comment')
- end
- end
-
- it 'should be added as discussion' do
- is_expected.to have_content('Another comment on line 10')
- is_expected.to have_css('.notes_holder')
- is_expected.to have_css('.notes_holder .note', count: 1)
- is_expected.to have_button('Reply')
- end
- end
- end
- end
-
- def line_code
- sample_compare.changes.first[:line_code]
- end
-
- def line_code_2
- sample_compare.changes.last[:line_code]
- end
-
- def click_diff_line(data = nil)
- data ||= line_code
- find("button[data-line-code=\"#{data}\"]").click
- end
-end
diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb
deleted file mode 100644
index 3d36a3c02d043cc989cfc682273d2c5c6b989e2d..0000000000000000000000000000000000000000
--- a/spec/features/profile_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-
-describe 'Profile account page', feature: true do
- let(:user) { create(:user) }
-
- before do
- login_as :user
- end
-
- describe 'when signup is enabled' do
- before do
- ApplicationSetting.any_instance.stub(signup_enabled?: true)
- visit profile_account_path
- end
-
- it { expect(page).to have_content('Remove account') }
-
- it 'should delete the account' do
- expect { click_link 'Delete account' }.to change { User.count }.by(-1)
- expect(current_path).to eq(new_user_session_path)
- end
- end
-
- describe 'when signup is disabled' do
- before do
- ApplicationSetting.any_instance.stub(signup_enabled?: false)
- visit profile_account_path
- end
-
- it 'should not have option to remove account' do
- expect(page).not_to have_content('Remove account')
- expect(current_path).to eq(profile_account_path)
- end
- end
-end
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
deleted file mode 100644
index cae11be7cdd32b06c30738d919ae1e077e5ba681..0000000000000000000000000000000000000000
--- a/spec/features/projects_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'spec_helper'
-
-describe "Projects", feature: true, js: true do
- before { login_as :user }
-
- describe "DELETE /projects/:id" do
- before do
- @project = create(:project, namespace: @user.namespace)
- @project.team << [@user, :master]
- visit edit_namespace_project_path(@project.namespace, @project)
- end
-
- it "should remove project" do
- expect { remove_project }.to change {Project.count}.by(-1)
- end
-
- it 'should delete the project from disk' do
- expect(GitlabShellWorker).to(
- receive(:perform_async).with(:remove_repository,
- /#{@project.path_with_namespace}/)
- ).twice
-
- remove_project
- end
- end
-
- def remove_project
- click_link "Remove project"
- fill_in 'confirm_name_input', with: @project.path
- click_button 'Confirm'
- end
-end
diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb
deleted file mode 100644
index 73987739a7a5ea67d08b995bc53d5820fdbabf75..0000000000000000000000000000000000000000
--- a/spec/features/search_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe "Search", feature: true do
- before do
- login_as :user
- @project = create(:project, namespace: @user.namespace)
- @project.team << [@user, :reporter]
- visit search_path
-
- within '.search-holder' do
- fill_in "search", with: @project.name[0..3]
- click_button "Search"
- end
- end
-
- it "should show project in search results" do
- expect(page).to have_content @project.name
- end
-end
-
diff --git a/spec/features/security/dashboard_access_spec.rb b/spec/features/security/dashboard_access_spec.rb
deleted file mode 100644
index 67238e3ab76029f1994bb9ddffeed26bb65fc291..0000000000000000000000000000000000000000
--- a/spec/features/security/dashboard_access_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require 'spec_helper'
-
-describe "Dashboard access", feature: true do
- describe "GET /dashboard" do
- subject { dashboard_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /dashboard/issues" do
- subject { issues_dashboard_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /dashboard/merge_requests" do
- subject { merge_requests_dashboard_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /dashboard/projects/starred" do
- subject { starred_dashboard_projects_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /help" do
- subject { help_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /projects/new" do
- it { expect(new_project_path).to be_allowed_for :admin }
- it { expect(new_project_path).to be_allowed_for :user }
- it { expect(new_project_path).to be_denied_for :visitor }
- end
-
- describe "GET /groups/new" do
- it { expect(new_group_path).to be_allowed_for :admin }
- it { expect(new_group_path).to be_allowed_for :user }
- it { expect(new_group_path).to be_denied_for :visitor }
- end
-
- describe "GET /profile/groups" do
- subject { dashboard_groups_path }
-
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/security/group/group_access_spec.rb b/spec/features/security/group/group_access_spec.rb
deleted file mode 100644
index 63793149459ab2b4a01a164628f443ced51d0f06..0000000000000000000000000000000000000000
--- a/spec/features/security/group/group_access_spec.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-require 'spec_helper'
-
-describe "Group access", feature: true do
- describe "GET /projects/new" do
- it { expect(new_group_path).to be_allowed_for :admin }
- it { expect(new_group_path).to be_allowed_for :user }
- it { expect(new_group_path).to be_denied_for :visitor }
- end
-
- describe "Group" do
- let(:group) { create(:group) }
-
- let(:owner) { create(:owner) }
- let(:master) { create(:user) }
- let(:reporter) { create(:user) }
- let(:guest) { create(:user) }
- let(:nonmember) { create(:user) }
-
- before do
- group.add_user(owner, Gitlab::Access::OWNER)
- group.add_user(master, Gitlab::Access::MASTER)
- group.add_user(reporter, Gitlab::Access::REPORTER)
- group.add_user(guest, Gitlab::Access::GUEST)
- end
-
- describe "GET /groups/:path" do
- subject { group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/issues" do
- subject { issues_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/merge_requests" do
- subject { merge_requests_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/group_members" do
- subject { group_group_members_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/edit" do
- subject { edit_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_denied_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/projects" do
- subject { projects_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_denied_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
- end
-end
diff --git a/spec/features/security/group/internal_group_access_spec.rb b/spec/features/security/group/internal_group_access_spec.rb
deleted file mode 100644
index d17a7412e43874c3ea826e3520958d20f154b7b7..0000000000000000000000000000000000000000
--- a/spec/features/security/group/internal_group_access_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require 'spec_helper'
-
-describe "Group with internal project access", feature: true do
- describe "Group" do
- let(:group) { create(:group) }
-
- let(:owner) { create(:owner) }
- let(:master) { create(:user) }
- let(:reporter) { create(:user) }
- let(:guest) { create(:user) }
- let(:nonmember) { create(:user) }
-
- before do
- group.add_user(owner, Gitlab::Access::OWNER)
- group.add_user(master, Gitlab::Access::MASTER)
- group.add_user(reporter, Gitlab::Access::REPORTER)
- group.add_user(guest, Gitlab::Access::GUEST)
-
- create(:project, :internal, group: group)
- end
-
- describe "GET /groups/:path" do
- subject { group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/issues" do
- subject { issues_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/merge_requests" do
- subject { merge_requests_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/group_members" do
- subject { group_group_members_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /groups/:path/edit" do
- subject { edit_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_denied_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
- end
-end
diff --git a/spec/features/security/group/mixed_group_access_spec.rb b/spec/features/security/group/mixed_group_access_spec.rb
deleted file mode 100644
index b3db7b5dea4404337e9eba20df6d6a85f9395efd..0000000000000000000000000000000000000000
--- a/spec/features/security/group/mixed_group_access_spec.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require 'spec_helper'
-
-describe "Group access", feature: true do
- describe "Group" do
- let(:group) { create(:group) }
-
- let(:owner) { create(:owner) }
- let(:master) { create(:user) }
- let(:reporter) { create(:user) }
- let(:guest) { create(:user) }
- let(:nonmember) { create(:user) }
-
- before do
- group.add_user(owner, Gitlab::Access::OWNER)
- group.add_user(master, Gitlab::Access::MASTER)
- group.add_user(reporter, Gitlab::Access::REPORTER)
- group.add_user(guest, Gitlab::Access::GUEST)
-
- create(:project, :internal, path: "internal_project", group: group)
- create(:project, :public, path: "public_project", group: group)
- end
-
- describe "GET /groups/:path" do
- subject { group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/issues" do
- subject { issues_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/merge_requests" do
- subject { merge_requests_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/group_members" do
- subject { group_group_members_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/edit" do
- subject { edit_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_denied_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
- end
-end
diff --git a/spec/features/security/group/public_group_access_spec.rb b/spec/features/security/group/public_group_access_spec.rb
deleted file mode 100644
index c16f0c0d1e1d004c7276c426a9f49b01d2b381fb..0000000000000000000000000000000000000000
--- a/spec/features/security/group/public_group_access_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-require 'spec_helper'
-
-describe "Group with public project access", feature: true do
- describe "Group" do
- let(:group) { create(:group) }
-
- let(:owner) { create(:owner) }
- let(:master) { create(:user) }
- let(:reporter) { create(:user) }
- let(:guest) { create(:user) }
- let(:nonmember) { create(:user) }
-
- before do
- group.add_user(owner, Gitlab::Access::OWNER)
- group.add_user(master, Gitlab::Access::MASTER)
- group.add_user(reporter, Gitlab::Access::REPORTER)
- group.add_user(guest, Gitlab::Access::GUEST)
-
- create(:project, :public, group: group)
- end
-
- describe "GET /groups/:path" do
- subject { group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/issues" do
- subject { issues_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/merge_requests" do
- subject { merge_requests_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/group_members" do
- subject { group_group_members_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /groups/:path/edit" do
- subject { edit_group_path(group) }
-
- it { is_expected.to be_allowed_for owner }
- it { is_expected.to be_denied_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
- end
-end
diff --git a/spec/features/security/profile_access_spec.rb b/spec/features/security/profile_access_spec.rb
deleted file mode 100644
index 2512a9c0e3d414a36f920ab780b22ebaa63a091d..0000000000000000000000000000000000000000
--- a/spec/features/security/profile_access_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe "Profile access", feature: true do
- before do
- @u1 = create(:user)
- end
-
- describe "GET /login" do
- it { expect(new_user_session_path).not_to be_404_for :visitor }
- end
-
- describe "GET /profile/keys" do
- subject { profile_keys_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /profile" do
- subject { profile_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /profile/account" do
- subject { profile_account_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /profile/design" do
- subject { design_profile_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /profile/history" do
- subject { history_profile_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /profile/notifications" do
- subject { profile_notifications_path }
-
- it { is_expected.to be_allowed_for @u1 }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb
deleted file mode 100644
index 8d1bfd2522337eef7eff0a7f7baf9b88755e8ff0..0000000000000000000000000000000000000000
--- a/spec/features/security/project/internal_access_spec.rb
+++ /dev/null
@@ -1,227 +0,0 @@
-require 'spec_helper'
-
-describe "Internal Project Access", feature: true do
- let(:project) { create(:project, :internal) }
-
- let(:master) { create(:user) }
- let(:guest) { create(:user) }
- let(:reporter) { create(:user) }
-
- before do
- # full access
- project.team << [master, :master]
-
- # readonly
- project.team << [reporter, :reporter]
- end
-
- describe "Project should be internal" do
- subject { project }
-
- describe '#internal?' do
- subject { super().internal? }
- it { is_expected.to be_truthy }
- end
- end
-
- describe "GET /:project_path" do
- subject { namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/tree/master" do
- subject { namespace_project_tree_path(project.namespace, project, project.repository.root_ref) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/commits/master" do
- subject { namespace_project_commits_path(project.namespace, project, project.repository.root_ref, limit: 1) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/commit/:sha" do
- subject { namespace_project_commit_path(project.namespace, project, project.repository.commit) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/compare" do
- subject { namespace_project_compare_index_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/project_members" do
- subject { namespace_project_project_members_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/blob" do
- before do
- commit = project.repository.commit
- path = '.gitignore'
- @blob_path = namespace_project_blob_path(project.namespace, project, File.join(commit.id, path))
- end
-
- it { expect(@blob_path).to be_allowed_for master }
- it { expect(@blob_path).to be_allowed_for reporter }
- it { expect(@blob_path).to be_allowed_for :admin }
- it { expect(@blob_path).to be_allowed_for guest }
- it { expect(@blob_path).to be_allowed_for :user }
- it { expect(@blob_path).to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/edit" do
- subject { edit_namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/deploy_keys" do
- subject { namespace_project_deploy_keys_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/issues" do
- subject { namespace_project_issues_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/snippets" do
- subject { namespace_project_snippets_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/snippets/new" do
- subject { new_namespace_project_snippet_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/merge_requests" do
- subject { namespace_project_merge_requests_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/merge_requests/new" do
- subject { new_namespace_project_merge_request_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/branches" do
- subject { namespace_project_branches_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:branches).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/tags" do
- subject { namespace_project_tags_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:tags).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/hooks" do
- subject { namespace_project_hooks_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb
deleted file mode 100644
index 9021ff331868772b533d7485235fd786e1d3ecb7..0000000000000000000000000000000000000000
--- a/spec/features/security/project/private_access_spec.rb
+++ /dev/null
@@ -1,205 +0,0 @@
-require 'spec_helper'
-
-describe "Private Project Access", feature: true do
- let(:project) { create(:project) }
-
- let(:master) { create(:user) }
- let(:guest) { create(:user) }
- let(:reporter) { create(:user) }
-
- before do
- # full access
- project.team << [master, :master]
-
- # readonly
- project.team << [reporter, :reporter]
- end
-
- describe "Project should be private" do
- subject { project }
-
- describe '#private?' do
- subject { super().private? }
- it { is_expected.to be_truthy }
- end
- end
-
- describe "GET /:project_path" do
- subject { namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/tree/master" do
- subject { namespace_project_tree_path(project.namespace, project, project.repository.root_ref) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/commits/master" do
- subject { namespace_project_commits_path(project.namespace, project, project.repository.root_ref, limit: 1) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/commit/:sha" do
- subject { namespace_project_commit_path(project.namespace, project, project.repository.commit) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/compare" do
- subject { namespace_project_compare_index_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/project_members" do
- subject { namespace_project_project_members_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/blob" do
- before do
- commit = project.repository.commit
- path = '.gitignore'
- @blob_path = namespace_project_blob_path(project.namespace, project, File.join(commit.id, path))
- end
-
- it { expect(@blob_path).to be_allowed_for master }
- it { expect(@blob_path).to be_allowed_for reporter }
- it { expect(@blob_path).to be_allowed_for :admin }
- it { expect(@blob_path).to be_denied_for guest }
- it { expect(@blob_path).to be_denied_for :user }
- it { expect(@blob_path).to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/edit" do
- subject { edit_namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/deploy_keys" do
- subject { namespace_project_deploy_keys_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/issues" do
- subject { namespace_project_issues_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/snippets" do
- subject { namespace_project_snippets_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/merge_requests" do
- subject { namespace_project_merge_requests_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/branches" do
- subject { namespace_project_branches_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:branches).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/tags" do
- subject { namespace_project_tags_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:tags).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/hooks" do
- subject { namespace_project_hooks_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb
deleted file mode 100644
index 6ec190ed777e81a323a5c966777eecae8ad991b1..0000000000000000000000000000000000000000
--- a/spec/features/security/project/public_access_spec.rb
+++ /dev/null
@@ -1,232 +0,0 @@
-require 'spec_helper'
-
-describe "Public Project Access", feature: true do
- let(:project) { create(:project) }
-
- let(:master) { create(:user) }
- let(:guest) { create(:user) }
- let(:reporter) { create(:user) }
-
- before do
- # public project
- project.visibility_level = Gitlab::VisibilityLevel::PUBLIC
- project.save!
-
- # full access
- project.team << [master, :master]
-
- # readonly
- project.team << [reporter, :reporter]
-
- end
-
- describe "Project should be public" do
- subject { project }
-
- describe '#public?' do
- subject { super().public? }
- it { is_expected.to be_truthy }
- end
- end
-
- describe "GET /:project_path" do
- subject { namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/tree/master" do
- subject { namespace_project_tree_path(project.namespace, project, project.repository.root_ref) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/commits/master" do
- subject { namespace_project_commits_path(project.namespace, project, project.repository.root_ref, limit: 1) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/commit/:sha" do
- subject { namespace_project_commit_path(project.namespace, project, project.repository.commit) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/compare" do
- subject { namespace_project_compare_index_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/project_members" do
- subject { namespace_project_project_members_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/blob" do
- before do
- commit = project.repository.commit
- path = '.gitignore'
- @blob_path = namespace_project_blob_path(project.namespace, project, File.join(commit.id, path))
- end
-
- it { expect(@blob_path).to be_allowed_for master }
- it { expect(@blob_path).to be_allowed_for reporter }
- it { expect(@blob_path).to be_allowed_for :admin }
- it { expect(@blob_path).to be_allowed_for guest }
- it { expect(@blob_path).to be_allowed_for :user }
- it { expect(@blob_path).to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/edit" do
- subject { edit_namespace_project_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/deploy_keys" do
- subject { namespace_project_deploy_keys_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/issues" do
- subject { namespace_project_issues_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/snippets" do
- subject { namespace_project_snippets_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/snippets/new" do
- subject { new_namespace_project_snippet_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/merge_requests" do
- subject { namespace_project_merge_requests_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/merge_requests/new" do
- subject { new_namespace_project_merge_request_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-
- describe "GET /:project_path/branches" do
- subject { namespace_project_branches_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:branches).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/tags" do
- subject { namespace_project_tags_path(project.namespace, project) }
-
- before do
- # Speed increase
- allow_any_instance_of(Project).to receive(:tags).and_return([])
- end
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_allowed_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_allowed_for guest }
- it { is_expected.to be_allowed_for :user }
- it { is_expected.to be_allowed_for :visitor }
- end
-
- describe "GET /:project_path/hooks" do
- subject { namespace_project_hooks_path(project.namespace, project) }
-
- it { is_expected.to be_allowed_for master }
- it { is_expected.to be_denied_for reporter }
- it { is_expected.to be_allowed_for :admin }
- it { is_expected.to be_denied_for guest }
- it { is_expected.to be_denied_for :user }
- it { is_expected.to be_denied_for :visitor }
- end
-end
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
deleted file mode 100644
index 4cfaab03caf0a7737534eac6a9101bfc853c90e3..0000000000000000000000000000000000000000
--- a/spec/features/users_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-
-feature 'Users' do
- around do |ex|
- old_url_options = Rails.application.routes.default_url_options
- Rails.application.routes.default_url_options = { host: 'example.foo' }
- ex.run
- Rails.application.routes.default_url_options = old_url_options
- end
-
- scenario 'GET /users/sign_in creates a new user account' do
- visit new_user_session_path
- fill_in 'user_name', with: 'Name Surname'
- fill_in 'user_username', with: 'Great'
- fill_in 'user_email', with: 'name@mail.com'
- fill_in 'user_password_sign_up', with: 'password1234'
- expect { click_button 'Sign up' }.to change { User.count }.by(1)
- end
-
- scenario 'Successful user signin invalidates password reset token' do
- user = create(:user)
- expect(user.reset_password_token).to be_nil
-
- visit new_user_password_path
- fill_in 'user_email', with: user.email
- click_button 'Reset password'
-
- user.reload
- expect(user.reset_password_token).not_to be_nil
-
- login_with(user)
- expect(current_path).to eq root_path
-
- user.reload
- expect(user.reset_password_token).to be_nil
- end
-end
diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb
deleted file mode 100644
index 479fa950387abfbb1e8921f71e5b6c3da9a0940d..0000000000000000000000000000000000000000
--- a/spec/finders/issues_finder_spec.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'spec_helper'
-
-describe IssuesFinder do
- let(:user) { create :user }
- let(:user2) { create :user }
- let(:project1) { create(:project) }
- let(:project2) { create(:project) }
- let(:milestone) { create(:milestone, project: project1) }
- let(:issue1) { create(:issue, author: user, assignee: user, project: project1, milestone: milestone) }
- let(:issue2) { create(:issue, author: user, assignee: user, project: project2) }
- let(:issue3) { create(:issue, author: user2, assignee: user2, project: project2) }
-
- before do
- project1.team << [user, :master]
- project2.team << [user, :developer]
- project2.team << [user2, :developer]
- end
-
- describe :execute do
- before :each do
- issue1
- issue2
- issue3
- end
-
- context 'scope: all' do
- it 'should filter by all' do
- params = { scope: "all", state: 'opened' }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues.size).to eq(3)
- end
-
- it 'should filter by assignee id' do
- params = { scope: "all", assignee_id: user.id, state: 'opened' }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues.size).to eq(2)
- end
-
- it 'should filter by author id' do
- params = { scope: "all", author_id: user2.id, state: 'opened' }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues).to eq([issue3])
- end
-
- it 'should filter by milestone id' do
- params = { scope: "all", milestone_id: milestone.id, state: 'opened' }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues).to eq([issue1])
- end
-
- it 'should be empty for unauthorized user' do
- params = { scope: "all", state: 'opened' }
- issues = IssuesFinder.new.execute(nil, params)
- expect(issues.size).to be_zero
- end
-
- it 'should not include unauthorized issues' do
- params = { scope: "all", state: 'opened' }
- issues = IssuesFinder.new.execute(user2, params)
- expect(issues.size).to eq(2)
- expect(issues).not_to include(issue1)
- expect(issues).to include(issue2)
- expect(issues).to include(issue3)
- end
- end
-
- context 'personal scope' do
- it 'should filter by assignee' do
- params = { scope: "assigned-to-me", state: 'opened' }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues.size).to eq(2)
- end
-
- it 'should filter by project' do
- params = { scope: "assigned-to-me", state: 'opened', project_id: project1.id }
- issues = IssuesFinder.new.execute(user, params)
- expect(issues.size).to eq(1)
- end
- end
- end
-end
diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb
deleted file mode 100644
index 8536377a7f079b534fd8ea9e728ee728e003ce86..0000000000000000000000000000000000000000
--- a/spec/finders/merge_requests_finder_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequestsFinder do
- let(:user) { create :user }
- let(:user2) { create :user }
-
- let(:project1) { create(:project) }
- let(:project2) { create(:project, forked_from_project: project1) }
-
- let!(:merge_request1) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project1) }
- let!(:merge_request2) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project1, state: 'closed') }
- let!(:merge_request3) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project2) }
-
- before do
- project1.team << [user, :master]
- project2.team << [user, :developer]
- project2.team << [user2, :developer]
- end
-
- describe "#execute" do
- it 'should filter by scope' do
- params = { scope: 'authored', state: 'opened' }
- merge_requests = MergeRequestsFinder.new.execute(user, params)
- expect(merge_requests.size).to eq(2)
- end
-
- it 'should filter by project' do
- params = { project_id: project1.id, scope: 'authored', state: 'opened' }
- merge_requests = MergeRequestsFinder.new.execute(user, params)
- expect(merge_requests.size).to eq(1)
- end
- end
-end
diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb
deleted file mode 100644
index c83824b900de0678ce22ebbe70be1bc237005113..0000000000000000000000000000000000000000
--- a/spec/finders/notes_finder_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-require 'spec_helper'
-
-describe NotesFinder do
- let(:user) { create :user }
- let(:project) { create :project }
- let(:note1) { create :note_on_commit, project: project }
- let(:note2) { create :note_on_commit, project: project }
- let(:commit) { note1.noteable }
-
- before do
- project.team << [user, :master]
- end
-
- describe :execute do
- let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } }
-
- before do
- note1
- note2
- end
-
- it 'should find all notes' do
- notes = NotesFinder.new.execute(project, user, params)
- expect(notes.size).to eq(2)
- end
-
- it 'should raise an exception for an invalid target_type' do
- params.merge!(target_type: 'invalid')
- expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type')
- end
-
- it 'filters out old notes' do
- note2.update_attribute(:updated_at, 2.hours.ago)
- notes = NotesFinder.new.execute(project, user, params)
- expect(notes).to eq([note1])
- end
- end
-end
diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb
deleted file mode 100644
index 2ab71b05968f81d20bc997f6ed2199e261dcad91..0000000000000000000000000000000000000000
--- a/spec/finders/projects_finder_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe ProjectsFinder do
- let(:user) { create :user }
- let(:group) { create :group }
-
- let(:project1) { create(:empty_project, :public, group: group) }
- let(:project2) { create(:empty_project, :internal, group: group) }
- let(:project3) { create(:empty_project, :private, group: group) }
- let(:project4) { create(:empty_project, :private, group: group) }
-
- context 'non authenticated' do
- subject { ProjectsFinder.new.execute(nil, group: group) }
-
- it { is_expected.to include(project1) }
- it { is_expected.not_to include(project2) }
- it { is_expected.not_to include(project3) }
- it { is_expected.not_to include(project4) }
- end
-
- context 'authenticated' do
- subject { ProjectsFinder.new.execute(user, group: group) }
-
- it { is_expected.to include(project1) }
- it { is_expected.to include(project2) }
- it { is_expected.not_to include(project3) }
- it { is_expected.not_to include(project4) }
- end
-
- context 'authenticated, project member' do
- before { project3.team << [user, :developer] }
-
- subject { ProjectsFinder.new.execute(user, group: group) }
-
- it { is_expected.to include(project1) }
- it { is_expected.to include(project2) }
- it { is_expected.to include(project3) }
- it { is_expected.not_to include(project4) }
- end
-
- context 'authenticated, group member' do
- before { group.add_user(user, Gitlab::Access::DEVELOPER) }
-
- subject { ProjectsFinder.new.execute(user, group: group) }
-
- it { is_expected.to include(project1) }
- it { is_expected.to include(project2) }
- it { is_expected.to include(project3) }
- it { is_expected.to include(project4) }
- end
-end
diff --git a/spec/finders/snippets_finder_spec.rb b/spec/finders/snippets_finder_spec.rb
deleted file mode 100644
index 1b4ffc2d7176e1fa2ef6d896c467c747c00f1323..0000000000000000000000000000000000000000
--- a/spec/finders/snippets_finder_spec.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require 'spec_helper'
-
-describe SnippetsFinder do
- let(:user) { create :user }
- let(:user1) { create :user }
- let(:group) { create :group }
-
- let(:project1) { create(:empty_project, :public, group: group) }
- let(:project2) { create(:empty_project, :private, group: group) }
-
-
- context ':all filter' do
- before do
- @snippet1 = create(:personal_snippet, visibility_level: Snippet::PRIVATE)
- @snippet2 = create(:personal_snippet, visibility_level: Snippet::INTERNAL)
- @snippet3 = create(:personal_snippet, visibility_level: Snippet::PUBLIC)
- end
-
- it "returns all private and internal snippets" do
- snippets = SnippetsFinder.new.execute(user, filter: :all)
- expect(snippets).to include(@snippet2, @snippet3)
- expect(snippets).not_to include(@snippet1)
- end
-
- it "returns all public snippets" do
- snippets = SnippetsFinder.new.execute(nil, filter: :all)
- expect(snippets).to include(@snippet3)
- expect(snippets).not_to include(@snippet1, @snippet2)
- end
- end
-
- context ':by_user filter' do
- before do
- @snippet1 = create(:personal_snippet, visibility_level: Snippet::PRIVATE, author: user)
- @snippet2 = create(:personal_snippet, visibility_level: Snippet::INTERNAL, author: user)
- @snippet3 = create(:personal_snippet, visibility_level: Snippet::PUBLIC, author: user)
- end
-
- it "returns all public and internal snippets" do
- snippets = SnippetsFinder.new.execute(user1, filter: :by_user, user: user)
- expect(snippets).to include(@snippet2, @snippet3)
- expect(snippets).not_to include(@snippet1)
- end
-
- it "returns internal snippets" do
- snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_internal")
- expect(snippets).to include(@snippet2)
- expect(snippets).not_to include(@snippet1, @snippet3)
- end
-
- it "returns private snippets" do
- snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_private")
- expect(snippets).to include(@snippet1)
- expect(snippets).not_to include(@snippet2, @snippet3)
- end
-
- it "returns public snippets" do
- snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user, scope: "are_public")
- expect(snippets).to include(@snippet3)
- expect(snippets).not_to include(@snippet1, @snippet2)
- end
-
- it "returns all snippets" do
- snippets = SnippetsFinder.new.execute(user, filter: :by_user, user: user)
- expect(snippets).to include(@snippet1, @snippet2, @snippet3)
- end
-
- it "returns only public snippets if unauthenticated user" do
- snippets = SnippetsFinder.new.execute(nil, filter: :by_user, user: user)
- expect(snippets).to include(@snippet3)
- expect(snippets).not_to include(@snippet2, @snippet1)
- end
-
- end
-
- context 'by_project filter' do
- before do
- @snippet1 = create(:project_snippet, visibility_level: Snippet::PRIVATE, project: project1)
- @snippet2 = create(:project_snippet, visibility_level: Snippet::INTERNAL, project: project1)
- @snippet3 = create(:project_snippet, visibility_level: Snippet::PUBLIC, project: project1)
- end
-
- it "returns public snippets for unauthorized user" do
- snippets = SnippetsFinder.new.execute(nil, filter: :by_project, project: project1)
- expect(snippets).to include(@snippet3)
- expect(snippets).not_to include(@snippet1, @snippet2)
- end
-
- it "returns public and internal snippets for none project members" do
- snippets = SnippetsFinder.new.execute(user, filter: :by_project, project: project1)
- expect(snippets).to include(@snippet2, @snippet3)
- expect(snippets).not_to include(@snippet1)
- end
-
- it "returns all snippets for project members" do
- project1.team << [user, :developer]
- snippets = SnippetsFinder.new.execute(user, filter: :by_project, project: project1)
- expect(snippets).to include(@snippet1, @snippet2, @snippet3)
- end
- end
-end
diff --git a/spec/fixtures/GoogleCodeProjectHosting.json b/spec/fixtures/GoogleCodeProjectHosting.json
deleted file mode 100644
index d05e77271ae0be5bf96dee120a9ea69e0c776ad8..0000000000000000000000000000000000000000
--- a/spec/fixtures/GoogleCodeProjectHosting.json
+++ /dev/null
@@ -1,407 +0,0 @@
-{
- "kind" : "projecthosting#user",
- "id" : "@WRRVSlFXARlCVgB6",
- "projects" : [ {
- "kind" : "projecthosting#project",
- "name" : "pmn",
- "externalId" : "pmn",
- "htmlLink" : "/p/pmn/",
- "summary" : "Shows an icon in the system tray when you have new emails",
- "description" : "IMAP client that shows an icon in the system tray when you have new emails.",
- "labels" : [ "Mail" ],
- "versionControlSystem" : "svn",
- "repositoryUrls" : [ "https://pmn.googlecode.com/svn/" ],
- "issuesConfig" : {
- "kind" : "projecthosting#projectIssueConfig",
- "statuses" : [ {
- "status" : "New",
- "meansOpen" : true,
- "description" : "Issue has not had initial review yet"
- }, {
- "status" : "Accepted",
- "meansOpen" : true,
- "description" : "Problem reproduced / Need acknowledged"
- }, {
- "status" : "Started",
- "meansOpen" : true,
- "description" : "Work on this issue has begun"
- }, {
- "status" : "Fixed",
- "meansOpen" : false,
- "description" : "Developer made source code changes, QA should verify"
- }, {
- "status" : "Verified",
- "meansOpen" : false,
- "description" : "QA has verified that the fix worked"
- }, {
- "status" : "Invalid",
- "meansOpen" : false,
- "description" : "This was not a valid issue report"
- }, {
- "status" : "Duplicate",
- "meansOpen" : false,
- "description" : "This report duplicates an existing issue"
- }, {
- "status" : "WontFix",
- "meansOpen" : false,
- "description" : "We decided to not take action on this issue"
- }, {
- "status" : "Done",
- "meansOpen" : false,
- "description" : "The requested non-coding task was completed"
- } ],
- "labels" : [ {
- "label" : "Type-Defect",
- "description" : "Report of a software defect"
- }, {
- "label" : "Type-Enhancement",
- "description" : "Request for enhancement"
- }, {
- "label" : "Type-Task",
- "description" : "Work item that doesn't change the code or docs"
- }, {
- "label" : "Type-Review",
- "description" : "Request for a source code review"
- }, {
- "label" : "Type-Other",
- "description" : "Some other kind of issue"
- }, {
- "label" : "Priority-Critical",
- "description" : "Must resolve in the specified milestone"
- }, {
- "label" : "Priority-High",
- "description" : "Strongly want to resolve in the specified milestone"
- }, {
- "label" : "Priority-Medium",
- "description" : "Normal priority"
- }, {
- "label" : "Priority-Low",
- "description" : "Might slip to later milestone"
- }, {
- "label" : "OpSys-All",
- "description" : "Affects all operating systems"
- }, {
- "label" : "OpSys-Windows",
- "description" : "Affects Windows users"
- }, {
- "label" : "OpSys-Linux",
- "description" : "Affects Linux users"
- }, {
- "label" : "OpSys-OSX",
- "description" : "Affects Mac OS X users"
- }, {
- "label" : "Milestone-Release1.0",
- "description" : "All essential functionality working"
- }, {
- "label" : "Component-UI",
- "description" : "Issue relates to program UI"
- }, {
- "label" : "Component-Logic",
- "description" : "Issue relates to application logic"
- }, {
- "label" : "Component-Persistence",
- "description" : "Issue relates to data storage components"
- }, {
- "label" : "Component-Scripts",
- "description" : "Utility and installation scripts"
- }, {
- "label" : "Component-Docs",
- "description" : "Issue relates to end-user documentation"
- }, {
- "label" : "Security",
- "description" : "Security risk to users"
- }, {
- "label" : "Performance",
- "description" : "Performance issue"
- }, {
- "label" : "Usability",
- "description" : "Affects program usability"
- }, {
- "label" : "Maintainability",
- "description" : "Hinders future changes"
- } ],
- "prompts" : [ {
- "name" : "Defect report from user",
- "title" : "Enter one-line summary",
- "description" : "What steps will reproduce the problem?\n1. \n2. \n3. \n\nWhat is the expected output? What do you see instead?\n\n\nWhat version of the product are you using? On what operating system?\n\n\nPlease provide any additional information below.\n",
- "titleMustBeEdited" : true,
- "status" : "New",
- "labels" : [ "Type-Defect", "Priority-Medium" ]
- }, {
- "name" : "Defect report from developer",
- "title" : "Enter one-line summary",
- "description" : "What steps will reproduce the problem?\n1. \n2. \n3. \n\nWhat is the expected output? What do you see instead?\n\n\nPlease use labels and text to provide additional information.\n",
- "titleMustBeEdited" : true,
- "status" : "Accepted",
- "labels" : [ "Type-Defect", "Priority-Medium" ],
- "membersOnly" : true
- }, {
- "name" : "Review request",
- "title" : "Code review request",
- "description" : "Branch name:\n\nPurpose of code changes on this branch:\n\n\nWhen reviewing my code changes, please focus on:\n\n\nAfter the review, I'll merge this branch into:\n/trunk\n",
- "status" : "New",
- "labels" : [ "Type-Review", "Priority-Medium" ],
- "membersOnly" : true,
- "defaultToMember" : false
- } ],
- "defaultPromptForMembers" : 1,
- "defaultPromptForNonMembers" : 0
- },
- "role" : "owner",
- "members" : [ {
- "kind" : "projecthosting#issuePerson",
- "name" : "mrovi9000",
- "htmlLink" : "https://code.google.com/u/106736353629303906862/"
- } ],
- "issues" : {
- "kind" : "projecthosting#issueList",
- "totalResults" : 0,
- "items" : [ ]
- }
- }, {
- "kind" : "projecthosting#project",
- "name" : "tint2",
- "externalId" : "tint2",
- "htmlLink" : "/p/tint2/",
- "summary" : "tint2 is a lightweight panel/taskbar.",
- "description" : "tint2 is a simple _*panel/taskbar*_ unintrusive and light (memory / cpu / aestetic).
We follow freedesktop specifications.\r\n \r\n=== 0.11 features ===\r\n * panel with taskbar, systray, clock and battery status\r\n * easy to customize : color/transparency on font, icon, border and background\r\n * pager like capability : send task from one workspace to another, switch workspace\r\n * multi-monitor capability : one panel per monitor, show task from current monitor\r\n * customize mouse event\r\n * window manager's menu\r\n * tooltip\r\n * autohide\r\n * clock timezones\r\n * real & fake transparency with autodetection of composite manager\r\n * panel's theme switcher 'tint2conf' \r\n\r\n=== Other project ===\r\n * Lightweight volume control http://softwarebakery.com/maato/volumeicon.html\r\n * Lightweight calendar http://code.google.com/p/gsimplecal/\r\n * Graphical config tool http://code.google.com/p/tintwizard/\r\n * Command line theme switcher http://github.com/dbbolton/scripts/blob/master/tint2theme\r\n\r\n\r\n=== Snapshot SVN ===\r\n\r\nhttp://img252.imageshack.us/img252/1433/wallpaper2td.jpg\r\n\r\n\r\n",
- "labels" : [ "taskbar", "panel", "lightweight", "desktop", "openbox", "pager", "tint2" ],
- "versionControlSystem" : "git",
- "repositoryUrls" : [ "https://tint2.googlecode.com/git/" ],
- "issuesConfig" : {
- "kind" : "projecthosting#projectIssueConfig",
- "defaultColumns" : [ "ID", "Status", "Type", "Milestone", "Priority", "Component", "Owner", "Summary", "Modified", "Stars" ],
- "defaultSorting" : [ "-ID" ],
- "statuses" : [ {
- "status" : "New",
- "meansOpen" : true,
- "description" : "Issue has not had initial review yet"
- }, {
- "status" : "NeedInfo",
- "meansOpen" : true,
- "description" : "More information is needed before deciding what action should be taken"
- }, {
- "status" : "Accepted",
- "meansOpen" : true,
- "description" : "A Defect that a developer has reproduced or an Enhancement that a developer has committed to addressing"
- }, {
- "status" : "Wishlist",
- "meansOpen" : true,
- "description" : "An Enhancement which is valid, but no developers have committed to addressing"
- }, {
- "status" : "Started",
- "meansOpen" : true,
- "description" : "Work on this issue has begun"
- }, {
- "status" : "Fixed",
- "meansOpen" : false,
- "description" : "Work has completed"
- }, {
- "status" : "Invalid",
- "meansOpen" : false,
- "description" : "This was not a valid issue report"
- }, {
- "status" : "Duplicate",
- "meansOpen" : false,
- "description" : "This report duplicates an existing issue"
- }, {
- "status" : "WontFix",
- "meansOpen" : false,
- "description" : "We decided to not take action on this issue"
- }, {
- "status" : "Incomplete",
- "meansOpen" : false,
- "description" : "Not enough information and no activity for a long period of time"
- } ],
- "labels" : [ {
- "label" : "Type-Defect",
- "description" : "Report of a software defect"
- }, {
- "label" : "Type-Enhancement",
- "description" : "Request for enhancement"
- }, {
- "label" : "Type-Task",
- "description" : "Work item that does not change the code"
- }, {
- "label" : "Type-Review",
- "description" : "Request for a source code review"
- }, {
- "label" : "Type-Other",
- "description" : "Some other kind of issue"
- }, {
- "label" : "Milestone-0.12",
- "description" : "Fix should be included in release 0.12"
- }, {
- "label" : "Priority-Critical",
- "description" : "Must resolve in the specified milestone"
- }, {
- "label" : "Priority-High",
- "description" : "Strongly want to resolve in the specified milestone"
- }, {
- "label" : "Priority-Medium",
- "description" : "Normal priority"
- }, {
- "label" : "Priority-Low",
- "description" : "Might slip to later milestone"
- }, {
- "label" : "OpSys-All",
- "description" : "Affects all operating systems"
- }, {
- "label" : "OpSys-Windows",
- "description" : "Affects Windows users"
- }, {
- "label" : "OpSys-Linux",
- "description" : "Affects Linux users"
- }, {
- "label" : "OpSys-OSX",
- "description" : "Affects Mac OS X users"
- }, {
- "label" : "Security",
- "description" : "Security risk to users"
- }, {
- "label" : "Performance",
- "description" : "Performance issue"
- }, {
- "label" : "Usability",
- "description" : "Affects program usability"
- }, {
- "label" : "Maintainability",
- "description" : "Hinders future changes"
- }, {
- "label" : "Component-Panel",
- "description" : "Issue relates to the panel (e.g. positioning, hiding, transparency)"
- }, {
- "label" : "Component-Taskbar",
- "description" : "Issue relates to the taskbar (e.g. tasks, multiple desktops)"
- }, {
- "label" : "Component-Battery",
- "description" : "Issue relates to the battery"
- }, {
- "label" : "Component-Systray",
- "description" : "Issue relates to the system tray"
- }, {
- "label" : "Component-Clock",
- "description" : "Issue relates to the clock"
- }, {
- "label" : "Component-Launcher",
- "description" : "Issue relates to the launcher"
- }, {
- "label" : "Component-Tint2conf",
- "description" : "Issue relates to the configuration GUI (tint2conf)"
- }, {
- "label" : "Component-Docs",
- "description" : "Issue relates to end-user documentation"
- }, {
- "label" : "Component-New",
- "description" : "Issue describes a new component proposal"
- } ],
- "prompts" : [ {
- "name" : "Defect report from user",
- "title" : "Enter one-line summary",
- "description" : "What steps will reproduce the problem?\n1.\n2.\n3.\n\nWhat is the expected output? What do you see instead?\n\n\nWhat version of the product are you using? On what operating system?\n\n\nWhich window manager (e.g. openbox, xfwm, metacity, mutter, kwin) or\nwhich desktop environment (e.g. Gnome 2, Gnome 3, LXDE, XFCE, KDE)\nare you using?\n\n\nPlease provide any additional information below. It might be helpful\nto attach your tint2rc file (usually located at ~/.config/tint2/tint2rc).",
- "titleMustBeEdited" : true,
- "status" : "New",
- "labels" : [ "Priority-Medium" ],
- "defaultToMember" : true
- }, {
- "name" : "Defect report from developer",
- "title" : "Enter one-line summary",
- "description" : "What steps will reproduce the problem?\n1.\n2.\n3.\n\nWhat is the expected output? What do you see instead?\n\n\nPlease use labels and text to provide additional information.",
- "titleMustBeEdited" : true,
- "status" : "Accepted",
- "labels" : [ "Type-Defect", "Priority-Medium" ],
- "membersOnly" : true,
- "defaultToMember" : true
- }, {
- "name" : "Review request",
- "title" : "Code review request",
- "description" : "Purpose of code changes on this branch:\n\n\nWhen reviewing my code changes, please focus on:\n\n\nAfter the review, I'll merge this branch into:\n/trunk",
- "status" : "New",
- "labels" : [ "Type-Review", "Priority-Medium" ],
- "membersOnly" : true,
- "defaultToMember" : true
- } ],
- "defaultPromptForMembers" : 1,
- "defaultPromptForNonMembers" : 0,
- "usersCanSetLabels" : false
- },
- "role" : "owner",
- "issues" : {
- "kind" : "projecthosting#issueList",
- "totalResults" : 473,
- "items" : [ {
- "kind" : "projecthosting#issue",
- "id" : 169,
- "title" : "Scrolling through tasks",
- "summary" : "Scrolling through tasks",
- "stars" : 1,
- "starred" : false,
- "status" : "Fixed",
- "state" : "closed",
- "labels" : [ "Type-Enhancement", "Priority-Medium" ],
- "author" : {
- "kind" : "projecthosting#issuePerson",
- "name" : "schattenpr...",
- "htmlLink" : "https://code.google.com/u/106498139506637530000/"
- },
- "owner" : {
- "kind" : "projecthosting#issuePerson",
- "name" : "thilo...",
- "htmlLink" : "https://code.google.com/u/104224918623172014000/"
- },
- "updated" : "2009-11-18T05:14:58.000Z",
- "published" : "2009-11-18T00:20:19.000Z",
- "closed" : "2009-11-18T05:14:58.000Z",
- "projectId" : "tint2",
- "canComment" : true,
- "canEdit" : true,
- "comments" : {
- "kind" : "projecthosting#issueCommentList",
- "totalResults" : 2,
- "items" : [ {
- "id" : 0,
- "kind" : "projecthosting#issueComment",
- "author" : {
- "kind" : "projecthosting#issuePerson",
- "name" : "schattenpr...",
- "htmlLink" : "https://code.google.com/u/10649813950663753000/"
- },
- "content" : "I like to scroll through the tasks with my scrollwheel (like in fluxbox). \r\n\r\nPatch is attached that adds two new mouse-actions (next_task+prev_task) \r\nthat can be used for exactly that purpose. \r\n\r\nall the best!",
- "published" : "2009-11-18T00:20:19.000Z",
- "updates" : {
- "kind" : "projecthosting#issueCommentUpdate"
- },
- "canDelete" : true,
- "attachments" : [ {
- "attachmentId" : "8901002890399325565",
- "fileName" : "tint2_task_scrolling.diff",
- "fileSize" : 3059,
- "mimetype" : "text/x-c++; charset=us-ascii"
- }, {
- "attachmentId" : "000",
- "fileName" : "screenshot.png",
- "fileSize" : 0,
- "mimetype" : "image/png"
- } ]
- }, {
- "id" : 1,
- "kind" : "projecthosting#issueComment",
- "author" : {
- "kind" : "projecthosting#issuePerson",
- "name" : "thilo...",
- "htmlLink" : "https://code.google.com/u/104224918623172014000/"
- },
- "content" : "applied, thanks.\r\n",
- "published" : "2009-11-18T05:14:58.000Z",
- "updates" : {
- "kind" : "projecthosting#issueCommentUpdate",
- "status" : "Fixed",
- "labels" : [ "-Type-Defect", "Type-Enhancement" ]
- },
- "canDelete" : true
- } ]
- }
- } ]
- }
- } ]
-}
diff --git a/spec/fixtures/banana_sample.gif b/spec/fixtures/banana_sample.gif
deleted file mode 100644
index 1322ac92d141f2240f3b68b1c4a10b5e18b49e2b..0000000000000000000000000000000000000000
Binary files a/spec/fixtures/banana_sample.gif and /dev/null differ
diff --git a/spec/fixtures/dk.png b/spec/fixtures/dk.png
deleted file mode 100644
index 87ce25e877ab8a9602b77af019f191e6749003f9..0000000000000000000000000000000000000000
Binary files a/spec/fixtures/dk.png and /dev/null differ
diff --git a/spec/fixtures/doc_sample.txt b/spec/fixtures/doc_sample.txt
deleted file mode 100644
index 600477e9421e2d06e2f1e6e716e76ce1d52b8c57..0000000000000000000000000000000000000000
--- a/spec/fixtures/doc_sample.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
diff --git a/spec/fixtures/rails_sample.jpg b/spec/fixtures/rails_sample.jpg
deleted file mode 100644
index a847b19332535844fe83840e16d3872902bb7441..0000000000000000000000000000000000000000
Binary files a/spec/fixtures/rails_sample.jpg and /dev/null differ
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
deleted file mode 100644
index 015a66f7fa02a46fc39d09137e2de0a2fc67d3cf..0000000000000000000000000000000000000000
--- a/spec/helpers/application_helper_spec.rb
+++ /dev/null
@@ -1,262 +0,0 @@
-require 'spec_helper'
-
-describe ApplicationHelper do
- describe 'current_controller?' do
- before do
- allow(controller).to receive(:controller_name).and_return('foo')
- end
-
- it 'returns true when controller matches argument' do
- expect(current_controller?(:foo)).to be_truthy
- end
-
- it 'returns false when controller does not match argument' do
- expect(current_controller?(:bar)).not_to be_truthy
- end
-
- it 'should take any number of arguments' do
- expect(current_controller?(:baz, :bar)).not_to be_truthy
- expect(current_controller?(:baz, :bar, :foo)).to be_truthy
- end
- end
-
- describe 'current_action?' do
- before do
- allow(self).to receive(:action_name).and_return('foo')
- end
-
- it 'returns true when action matches argument' do
- expect(current_action?(:foo)).to be_truthy
- end
-
- it 'returns false when action does not match argument' do
- expect(current_action?(:bar)).not_to be_truthy
- end
-
- it 'should take any number of arguments' do
- expect(current_action?(:baz, :bar)).not_to be_truthy
- expect(current_action?(:baz, :bar, :foo)).to be_truthy
- end
- end
-
- describe 'project_icon' do
- avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png')
-
- it 'should return an url for the avatar' do
- project = create(:project)
- project.avatar = File.open(avatar_file_path)
- project.save!
- avatar_url = "http://localhost/uploads/project/avatar/#{ project.id }/gitlab_logo.png"
- expect(project_icon("#{project.namespace.to_param}/#{project.to_param}").to_s).to eq(
- ""
- )
- end
-
- it 'should give uploaded icon when present' do
- project = create(:project)
- project.save!
-
- allow_any_instance_of(Project).to receive(:avatar_in_git).and_return(true)
-
- avatar_url = 'http://localhost' + namespace_project_avatar_path(project.namespace, project)
- expect(project_icon("#{project.namespace.to_param}/#{project.to_param}").to_s).to match(
- image_tag(avatar_url))
- end
- end
-
- describe 'avatar_icon' do
- avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png')
-
- it 'should return an url for the avatar' do
- user = create(:user)
- user.avatar = File.open(avatar_file_path)
- user.save!
- expect(avatar_icon(user.email).to_s).
- to match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png")
- end
-
- it 'should return an url for the avatar with relative url' do
- Gitlab.config.gitlab.stub(relative_url_root: '/gitlab')
- Gitlab.config.gitlab.stub(url: Settings.send(:build_gitlab_url))
-
- user = create(:user)
- user.avatar = File.open(avatar_file_path)
- user.save!
- expect(avatar_icon(user.email).to_s).
- to match("/gitlab/uploads/user/avatar/#{ user.id }/gitlab_logo.png")
- end
-
- it 'should call gravatar_icon when no avatar is present' do
- user = create(:user, email: 'test@example.com')
- user.save!
- expect(avatar_icon(user.email).to_s).to eq('http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=40&d=identicon')
- end
- end
-
- describe 'gravatar_icon' do
- let(:user_email) { 'user@email.com' }
-
- it 'should return a generic avatar path when Gravatar is disabled' do
- ApplicationSetting.any_instance.stub(gravatar_enabled?: false)
- expect(gravatar_icon(user_email)).to match('no_avatar.png')
- end
-
- it 'should return a generic avatar path when email is blank' do
- expect(gravatar_icon('')).to match('no_avatar.png')
- end
-
- it 'should return default gravatar url' do
- Gitlab.config.gitlab.stub(https: false)
- url = 'http://www.gravatar.com/avatar/b58c6f14d292556214bd64909bcdb118'
- expect(gravatar_icon(user_email)).to match(url)
- end
-
- it 'should use SSL when appropriate' do
- Gitlab.config.gitlab.stub(https: true)
- expect(gravatar_icon(user_email)).to match('https://secure.gravatar.com')
- end
-
- it 'should return custom gravatar path when gravatar_url is set' do
- allow(self).to receive(:request).and_return(double(:ssl? => false))
- allow(Gitlab.config.gravatar).
- to receive(:plain_url).
- and_return('http://example.local/?s=%{size}&hash=%{hash}')
- url = 'http://example.local/?s=20&hash=b58c6f14d292556214bd64909bcdb118'
- expect(gravatar_icon(user_email, 20)).to eq(url)
- end
-
- it 'should accept a custom size' do
- allow(self).to receive(:request).and_return(double(:ssl? => false))
- expect(gravatar_icon(user_email, 64)).to match(/\?s=64/)
- end
-
- it 'should use default size when size is wrong' do
- allow(self).to receive(:request).and_return(double(:ssl? => false))
- expect(gravatar_icon(user_email, nil)).to match(/\?s=40/)
- end
-
- it 'should be case insensitive' do
- allow(self).to receive(:request).and_return(double(:ssl? => false))
- expect(gravatar_icon(user_email)).
- to eq(gravatar_icon(user_email.upcase + ' '))
- end
- end
-
- describe 'grouped_options_refs' do
- # Override Rails' grouped_options_for_select helper since HTML is harder to work with
- def grouped_options_for_select(options, *args)
- options
- end
-
- let(:options) { grouped_options_refs }
-
- before do
- # Must be an instance variable
- @project = create(:project)
- end
-
- it 'includes a list of branch names' do
- expect(options[0][0]).to eq('Branches')
- expect(options[0][1]).to include('master', 'feature')
- end
-
- it 'includes a list of tag names' do
- expect(options[1][0]).to eq('Tags')
- expect(options[1][1]).to include('v1.0.0', 'v1.1.0')
- end
-
- it 'includes a specific commit ref if defined' do
- # Must be an instance variable
- @ref = '2ed06dc41dbb5936af845b87d79e05bbf24c73b8'
-
- expect(options[2][0]).to eq('Commit')
- expect(options[2][1]).to eq([@ref])
- end
-
- it 'sorts tags in a natural order' do
- # Stub repository.tag_names to make sure we get some valid testing data
- expect(@project.repository).to receive(:tag_names).
- and_return(['v1.0.9', 'v1.0.10', 'v2.0', 'v3.1.4.2', 'v2.0rc1¿',
- 'v1.0.9a', 'v2.0-rc1', 'v2.0rc2'])
-
- expect(options[1][1]).
- to eq(['v3.1.4.2', 'v2.0', 'v2.0rc2', 'v2.0rc1¿', 'v2.0-rc1', 'v1.0.10',
- 'v1.0.9', 'v1.0.9a'])
- end
- end
-
- describe 'user_color_scheme_class' do
- context 'with current_user is nil' do
- it 'should return a string' do
- allow(self).to receive(:current_user).and_return(nil)
- expect(user_color_scheme_class).to be_kind_of(String)
- end
- end
-
- context 'with a current_user' do
- (1..5).each do |color_scheme_id|
- context "with color_scheme_id == #{color_scheme_id}" do
- it 'should return a string' do
- current_user = double(:color_scheme_id => color_scheme_id)
- allow(self).to receive(:current_user).and_return(current_user)
- expect(user_color_scheme_class).to be_kind_of(String)
- end
- end
- end
- end
- end
-
- describe 'simple_sanitize' do
- let(:a_tag) { 'Foo' }
-
- it 'allows the a tag' do
- expect(simple_sanitize(a_tag)).to eq(a_tag)
- end
-
- it 'allows the span tag' do
- input = 'Bar'
- expect(simple_sanitize(input)).to eq(input)
- end
-
- it 'disallows other tags' do
- input = "
#{a_tag}"
- expect(simple_sanitize(input)).to eq(a_tag)
- end
- end
-
- describe 'link_to' do
- it 'should not include rel=nofollow for internal links' do
- expect(link_to('Home', root_path)).to eq('Home')
- end
-
- it 'should include rel=nofollow for external links' do
- expect(link_to('Example', 'http://www.example.com')).
- to eq 'Example'
- end
-
- it 'should include rel=nofollow for external links and honor existing html_options' do
- expect(link_to('Example', 'http://www.example.com', class: 'toggle', data: {toggle: 'dropdown'}))
- .to eq 'Example'
- end
-
- it 'should include rel=nofollow for external links and preserve other rel values' do
- expect(link_to('Example', 'http://www.example.com', rel: 'noreferrer'))
- .to eq 'Example'
- end
-
- it 'should not include rel=nofollow for external links on the same host as GitLab' do
- expect(Gitlab.config.gitlab).to receive(:host).and_return('example.foo')
- expect(link_to('Example', 'http://example.foo/bar')).
- to eq 'Example'
- end
- end
-
- describe 'markup_render' do
- let(:content) { 'Noël' }
-
- it 'should preserve encoding' do
- expect(content.encoding.name).to eq('UTF-8')
- expect(render_markup('foo.rst', content).encoding.name).to eq('UTF-8')
- end
- end
-end
diff --git a/spec/helpers/broadcast_messages_helper_spec.rb b/spec/helpers/broadcast_messages_helper_spec.rb
deleted file mode 100644
index f6df12662bb1a78a44d1647823d8f538979274c6..0000000000000000000000000000000000000000
--- a/spec/helpers/broadcast_messages_helper_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'spec_helper'
-
-describe BroadcastMessagesHelper do
- describe 'broadcast_styling' do
- let(:broadcast_message) { double(color: "", font: "") }
-
- context "default style" do
- it "should have no style" do
- expect(broadcast_styling(broadcast_message)).to match('')
- end
- end
-
- context "customiezd style" do
- before { broadcast_message.stub(color: "#f2dede", font: "#b94a48") }
-
- it "should have a customized style" do
- expect(broadcast_styling(broadcast_message)).
- to match('background-color:#f2dede;color:#b94a48')
- end
- end
- end
-end
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb
deleted file mode 100644
index 5bd09793b11dac1209da4d095263dc0b728d1181..0000000000000000000000000000000000000000
--- a/spec/helpers/diff_helper_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require 'spec_helper'
-
-describe DiffHelper do
- include RepoHelpers
-
- let(:project) { create(:project) }
- let(:commit) { project.repository.commit(sample_commit.id) }
- let(:diff) { commit.diffs.first }
- let(:diff_file) { Gitlab::Diff::File.new(diff) }
-
- describe 'diff_hard_limit_enabled?' do
- it 'should return true if param is provided' do
- allow(controller).to receive(:params) { { force_show_diff: true } }
- expect(diff_hard_limit_enabled?).to be_truthy
- end
-
- it 'should return false if param is not provided' do
- expect(diff_hard_limit_enabled?).to be_falsey
- end
- end
-
- describe 'allowed_diff_size' do
- it 'should return hard limit for a diff if force diff is true' do
- allow(controller).to receive(:params) { { force_show_diff: true } }
- expect(allowed_diff_size).to eq(1000)
- end
-
- it 'should return safe limit for a diff if force diff is false' do
- expect(allowed_diff_size).to eq(100)
- end
- end
-
- describe 'parallel_diff' do
- it 'should return an array of arrays containing the parsed diff' do
- expect(parallel_diff(diff_file, 0)).
- to match_array(parallel_diff_result_array)
- end
- end
-
- describe 'generate_line_code' do
- it 'should generate correct line code' do
- expect(generate_line_code(diff_file.file_path, diff_file.diff_lines.first)).
- to eq('2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6')
- end
- end
-
- describe 'unfold_bottom_class' do
- it 'should return empty string when bottom line shouldnt be unfolded' do
- expect(unfold_bottom_class(false)).to eq('')
- end
-
- it 'should return js class when bottom lines should be unfolded' do
- expect(unfold_bottom_class(true)).to eq('js-unfold-bottom')
- end
- end
-
- describe 'diff_line_content' do
-
- it 'should return non breaking space when line is empty' do
- expect(diff_line_content(nil)).to eq(' ')
- end
-
- it 'should return the line itself' do
- expect(diff_line_content(diff_file.diff_lines.first.text)).
- to eq('@@ -6,12 +6,18 @@ module Popen')
- expect(diff_line_content(diff_file.diff_lines.first.type)).to eq('match')
- expect(diff_line_content(diff_file.diff_lines.first.new_pos)).to eq(6)
- end
- end
-
- def parallel_diff_result_array
- [
- ["match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", "match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"],
- [nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"], [nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7", nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"],
- [nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8", nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8"],
- ["old", 9, "- raise "System commands must be given as an array of strings"", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9", "new", 9, "+ raise RuntimeError, "System commands must be given as an array of strings"", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"],
- [nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10", nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10"],
- [nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11", nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11"],
- [nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12", nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12"],
- ["old", 13, "- vars = { "PWD" => path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13", "old", nil, " ", nil],
- ["old", 14, "- options = { chdir: path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_14_13", "new", 13, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_13"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14", "new", 14, "+ vars = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15", "new", 15, "+ "PWD" => path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16", "new", 16, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17", "new", 17, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18", "new", 18, "+ options = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19", "new", 19, "+ chdir: path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20", "new", 20, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20"],
- [nil, 15, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21", nil, 21, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21"],
- [nil, 16, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22", nil, 22, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22"],
- [nil, 17, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23", nil, 23, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23"],
- ["match", 19, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", "match", 25, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"],
- [nil, 19, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", nil, 25, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"],
- [nil, 20, " @cmd_output = """, "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26", nil, 26, " @cmd_output = """, "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26"],
- [nil, 21, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27", nil, 27, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27"],
- [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28", "new", 28, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28"],
- [nil, 22, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29", nil, 29, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29"],
- [nil, 23, " @cmd_output << stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30", nil, 30, " @cmd_output << stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30"],
- [nil, 24, " @cmd_output << stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31", nil, 31, " @cmd_output << stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31"]
- ]
- end
-end
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb
deleted file mode 100644
index b392371deb4c427d6deb16b472462f8a0b4786e5..0000000000000000000000000000000000000000
--- a/spec/helpers/events_helper_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe EventsHelper do
- include ApplicationHelper
- include GitlabMarkdownHelper
-
- let(:current_user) { create(:user, email: "current@email.com") }
-
- it 'should display one line of plain text without alteration' do
- input = 'A short, plain note'
- expect(event_note(input)).to match(input)
- expect(event_note(input)).not_to match(/\.\.\.\z/)
- end
-
- it 'should display inline code' do
- input = 'A note with `inline code`'
- expected = 'A note with inline code'
-
- expect(event_note(input)).to match(expected)
- end
-
- it 'should truncate a note with multiple paragraphs' do
- input = "Paragraph 1\n\nParagraph 2"
- expected = 'Paragraph 1...'
-
- expect(event_note(input)).to match(expected)
- end
-
- it 'should display the first line of a code block' do
- input = "```\nCode block\nwith two lines\n```"
- expected = '
'
-
- expect(event_note(input)).to match(expected)
- end
-
- it 'should truncate a single long line of text' do
- text = 'The quick brown fox jumped over the lazy dog twice' # 50 chars
- input = "#{text}#{text}#{text}#{text}" # 200 chars
- expected = "#{text}#{text}".sub(/.{3}/, '...')
-
- expect(event_note(input)).to match(expected)
- end
-
- it 'should preserve a link href when link text is truncated' do
- text = 'The quick brown fox jumped over the lazy dog' # 44 chars
- input = "#{text}#{text}#{text} " # 133 chars
- link_url = 'http://example.com/foo/bar/baz' # 30 chars
- input << link_url
- expected_link_text = 'http://example...' \
- 'Code block...
' \
- "def test\n" \
- " \'hello world\'\n" \
- "end\n" \
- ''
- expect(event_note(input)).to eq(expected)
- end
-end
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
deleted file mode 100644
index 944e743675c7d91cb67007ddb7ed1ba521c53c16..0000000000000000000000000000000000000000
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ /dev/null
@@ -1,916 +0,0 @@
-require 'spec_helper'
-
-describe GitlabMarkdownHelper do
- include ApplicationHelper
- include IssuesHelper
-
- # TODO: Properly test this
- def can?(*)
- true
- end
-
- let!(:project) { create(:project) }
- let(:empty_project) { create(:empty_project) }
-
- let(:user) { create(:user, username: 'gfm') }
- let(:commit) { project.repository.commit }
- let(:earlier_commit){ project.repository.commit("HEAD~2") }
- let(:issue) { create(:issue, project: project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:snippet) { create(:project_snippet, project: project) }
- let(:member) { project.project_members.where(user_id: user).first }
-
- # Helper expects a current_user method.
- let(:current_user) { user }
-
- def url_helper(image_name)
- File.join(root_url, 'assets', image_name)
- end
-
- before do
- # Helper expects a @project instance variable
- @project = project
- @ref = 'markdown'
- @repository = project.repository
- @request.host = Gitlab.config.gitlab.host
- end
-
- describe "#gfm" do
- it "should return unaltered text if project is nil" do
- actual = "Testing references: ##{issue.iid}"
-
- expect(gfm(actual)).not_to eq(actual)
-
- @project = nil
- expect(gfm(actual)).to eq(actual)
- end
-
- it "should not alter non-references" do
- actual = expected = "_Please_ *stop* 'helping' and all the other b*$#%' you do."
- expect(gfm(actual)).to eq(expected)
- end
-
- it "should not touch HTML entities" do
- allow(@project.issues).to receive(:where).
- with(id: '39').and_return([issue])
- actual = 'We'll accept good pull requests.'
- expect(gfm(actual)).to eq("We'll accept good pull requests.")
- end
-
- it "should forward HTML options to links" do
- expect(gfm("Fixed in #{commit.id}", @project, class: 'foo')).
- to have_selector('a.gfm.foo')
- end
-
- describe "referencing a commit range" do
- let(:expected) { namespace_project_compare_path(project.namespace, project, from: earlier_commit.id, to: commit.id) }
-
- it "should link using a full id" do
- actual = "What happened in #{earlier_commit.id}...#{commit.id}"
- expect(gfm(actual)).to match(expected)
- end
-
- it "should link using a short id" do
- actual = "What happened in #{earlier_commit.short_id}...#{commit.short_id}"
- expected = namespace_project_compare_path(project.namespace, project, from: earlier_commit.short_id, to: commit.short_id)
- expect(gfm(actual)).to match(expected)
- end
-
- it "should link inclusively" do
- actual = "What happened in #{earlier_commit.id}..#{commit.id}"
- expected = namespace_project_compare_path(project.namespace, project, from: "#{earlier_commit.id}^", to: commit.id)
- expect(gfm(actual)).to match(expected)
- end
-
- it "should link with adjacent text" do
- actual = "(see #{earlier_commit.id}...#{commit.id})"
- expect(gfm(actual)).to match(expected)
- end
-
- it "should keep whitespace intact" do
- actual = "Changes #{earlier_commit.id}...#{commit.id} dramatically"
- expected = /Changes it is @gfm\'s task.<\/code>/
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle references in " do
- actual = "Apply _!#{merge_request.iid}_ ASAP"
-
- expect(markdown(actual)).
- to match(%r{Apply !#{merge_request.iid} })
- end
-
- it "should handle tables" do
- actual = %Q{| header 1 | header 2 |
-| -------- | -------- |
-| cell 1 | cell 2 |
-| cell 3 | cell 4 |}
-
- expect(markdown(actual)).to match(/\Asome code from $#{snippet.id}\nhere too\n\n"
-
- expect(helper.markdown("\n some code from $#{snippet.id}\n here too\n")).
- to eq(target_html)
- expect(helper.markdown("\n```\nsome code from $#{snippet.id}\nhere too\n```\n")).
- to eq(target_html)
- end
-
- it "should leave inline code untouched" do
- expect(markdown("\nDon't use `$#{snippet.id}` here.\n")).to eq(
- "Don't use $#{snippet.id} here.
\n"
- )
- end
-
- it "should leave ref-like autolinks untouched" do
- expect(markdown("look at http://example.tld/#!#{merge_request.iid}")).to eq("look at http://example.tld/#!#{merge_request.iid}
\n")
- end
-
- it "should leave ref-like href of 'manual' links untouched" do
- expect(markdown("why not [inspect !#{merge_request.iid}](http://example.tld/#!#{merge_request.iid})")).to eq("why not inspect !#{merge_request.iid}
\n")
- end
-
- it "should leave ref-like src of images untouched" do
- expect(markdown("screen shot: ")).to eq("screen shot: 
\n")
- end
-
- it "should generate absolute urls for refs" do
- expect(markdown("##{issue.iid}")).to include(namespace_project_issue_path(project.namespace, project, issue))
- end
-
- it "should generate absolute urls for emoji" do
- expect(markdown(':smile:')).to(
- include(%(src="#{Gitlab.config.gitlab.url}/assets/emoji/#{Emoji.emoji_filename('smile')}.png))
- )
- end
-
- it "should generate absolute urls for emoji if relative url is present" do
- allow(Gitlab.config.gitlab).to receive(:url).and_return('http://localhost/gitlab/root')
- expect(markdown(":smile:")).to include("src=\"http://localhost/gitlab/root/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
- end
-
- it "should generate absolute urls for emoji if asset_host is present" do
- allow(Gitlab::Application.config).to receive(:asset_host).and_return("https://cdn.example.com")
- ActionView::Base.any_instance.stub_chain(:config, :asset_host).and_return("https://cdn.example.com")
- expect(markdown(":smile:")).to include("src=\"https://cdn.example.com/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
- end
-
-
- it "should handle relative urls for a file in master" do
- actual = "[GitLab API doc](doc/api/README.md)\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle relative urls for a file in master with an anchor" do
- actual = "[GitLab API doc](doc/api/README.md#section)\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should not handle relative urls for the current file with an anchor" do
- actual = "[GitLab API doc](#section)\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle relative urls for a directory in master" do
- actual = "[GitLab API doc](doc/api)\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle absolute urls" do
- actual = "[GitLab](https://www.gitlab.com)\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle relative urls in reference links for a file in master" do
- actual = "[GitLab API doc][GitLab readme]\n [GitLab readme]: doc/api/README.md\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should handle relative urls in reference links for a directory in master" do
- actual = "[GitLab API doc directory][GitLab readmes]\n [GitLab readmes]: doc/api/\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
-
- it "should not handle malformed relative urls in reference links for a file in master" do
- actual = "[GitLab readme]: doc/api/README.md\n"
- expected = ""
- expect(markdown(actual)).to match(expected)
- end
-
- it 'should allow whitelisted HTML tags from the user' do
- actual = '- Term
- Definition
'
- expect(markdown(actual)).to match(actual)
- end
-
- it 'should sanitize tags that are not whitelisted' do
- actual = ' '
- expected = 'no inputs allowed no blinks'
- expect(markdown(actual)).to match(expected)
- expect(markdown(actual)).not_to match('<.textarea>')
- expect(markdown(actual)).not_to match('<.blink>')
- end
-
- it 'should allow whitelisted tag attributes from the user' do
- actual = 'link text'
- expect(markdown(actual)).to match(actual)
- end
-
- it 'should sanitize tag attributes that are not whitelisted' do
- actual = 'link text'
- expected = 'link text'
- expect(markdown(actual)).to match(expected)
- end
-
- it 'should sanitize javascript in attributes' do
- actual = %q(link text)
- expected = 'link text'
- expect(markdown(actual)).to match(expected)
- end
- end
-
- describe 'markdown for empty repository' do
- before do
- @project = empty_project
- @repository = empty_project.repository
- end
-
- it "should not touch relative urls" do
- actual = "[GitLab API doc][GitLab readme]\n [GitLab readme]: doc/api/README.md\n"
- expected = "\n"
- expect(markdown(actual)).to match(expected)
- end
- end
-
- describe "#render_wiki_content" do
- before do
- @wiki = double('WikiPage')
- allow(@wiki).to receive(:content).and_return('wiki content')
- end
-
- it "should use GitLab Flavored Markdown for markdown files" do
- allow(@wiki).to receive(:format).and_return(:markdown)
-
- expect(helper).to receive(:markdown).with('wiki content')
-
- helper.render_wiki_content(@wiki)
- end
-
- it "should use the Gollum renderer for all other file types" do
- allow(@wiki).to receive(:format).and_return(:rdoc)
- formatted_content_stub = double('formatted_content')
- expect(formatted_content_stub).to receive(:html_safe)
- allow(@wiki).to receive(:formatted_content).and_return(formatted_content_stub)
-
- helper.render_wiki_content(@wiki)
- end
- end
-
- describe '#gfm_with_tasks' do
- before(:all) do
- @source_text_asterisk = </)
- expect(nav_link(controller: :bar)).not_to match(/active/)
- expect(nav_link(controller: [:foo, :bar])).to match(/active/)
- end
-
- it "performs checks on the current action" do
- expect(nav_link(action: :foo)).to match(//)
- expect(nav_link(action: :bar)).not_to match(/active/)
- expect(nav_link(action: [:foo, :bar])).to match(/active/)
- end
-
- it "performs checks on both controller and action when both are present" do
- expect(nav_link(controller: :bar, action: :foo)).not_to match(/active/)
- expect(nav_link(controller: :foo, action: :bar)).not_to match(/active/)
- expect(nav_link(controller: :foo, action: :foo)).to match(/active/)
- end
-
- it "accepts a path shorthand" do
- expect(nav_link(path: 'foo#bar')).not_to match(/active/)
- expect(nav_link(path: 'foo#foo')).to match(/active/)
- end
-
- it "passes extra html options to the list element" do
- expect(nav_link(action: :foo, html_options: {class: 'home'})).to match(/ /)
- expect(nav_link(html_options: {class: 'active'})).to match(/ /)
- end
- end
-end
diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb
deleted file mode 100644
index 8271e00f41b24f03669224eaf86cc7d2653efa71..0000000000000000000000000000000000000000
--- a/spec/helpers/tree_helper_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe TreeHelper do
- describe 'flatten_tree' do
- let(:project) { create(:project) }
-
- before {
- @repository = project.repository
- @commit = project.repository.commit("e56497bb")
- }
-
- context "on a directory containing more than one file/directory" do
- let(:tree_item) { double(name: "files", path: "files") }
-
- it "should return the directory name" do
- expect(flatten_tree(tree_item)).to match('files')
- end
- end
-
- context "on a directory containing only one directory" do
- let(:tree_item) { double(name: "foo", path: "foo") }
-
- it "should return the flattened path" do
- expect(flatten_tree(tree_item)).to match('foo/bar')
- end
- end
- end
-end
diff --git a/spec/javascripts/helpers/.gitkeep b/spec/javascripts/helpers/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/spec/javascripts/stat_graph_contributors_graph_spec.js b/spec/javascripts/stat_graph_contributors_graph_spec.js
deleted file mode 100644
index 1090cb7f620724bc757387a0a58cff5283526e3d..0000000000000000000000000000000000000000
--- a/spec/javascripts/stat_graph_contributors_graph_spec.js
+++ /dev/null
@@ -1,126 +0,0 @@
-describe("ContributorsGraph", function () {
- describe("#set_x_domain", function () {
- it("set the x_domain", function () {
- ContributorsGraph.set_x_domain(20)
- expect(ContributorsGraph.prototype.x_domain).toEqual(20)
- })
- })
-
- describe("#set_y_domain", function () {
- it("sets the y_domain", function () {
- ContributorsGraph.set_y_domain([{commits: 30}])
- expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30])
- })
- })
-
- describe("#init_x_domain", function () {
- it("sets the initial x_domain", function () {
- ContributorsGraph.init_x_domain([{date: "2013-01-31"}, {date: "2012-01-31"}])
- expect(ContributorsGraph.prototype.x_domain).toEqual(["2012-01-31", "2013-01-31"])
- })
- })
-
- describe("#init_y_domain", function () {
- it("sets the initial y_domain", function () {
- ContributorsGraph.init_y_domain([{commits: 30}])
- expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30])
- })
- })
-
- describe("#init_domain", function () {
- it("calls init_x_domain and init_y_domain", function () {
- spyOn(ContributorsGraph, "init_x_domain")
- spyOn(ContributorsGraph, "init_y_domain")
- ContributorsGraph.init_domain()
- expect(ContributorsGraph.init_x_domain).toHaveBeenCalled()
- expect(ContributorsGraph.init_y_domain).toHaveBeenCalled()
- })
- })
-
- describe("#set_dates", function () {
- it("sets the dates", function () {
- ContributorsGraph.set_dates("2013-12-01")
- expect(ContributorsGraph.prototype.dates).toEqual("2013-12-01")
- })
- })
-
- describe("#set_x_domain", function () {
- it("sets the instance's x domain using the prototype's x_domain", function () {
- ContributorsGraph.prototype.x_domain = 20
- var instance = new ContributorsGraph()
- instance.x = d3.time.scale().range([0, 100]).clamp(true)
- spyOn(instance.x, 'domain')
- instance.set_x_domain()
- expect(instance.x.domain).toHaveBeenCalledWith(20)
- })
- })
-
- describe("#set_y_domain", function () {
- it("sets the instance's y domain using the prototype's y_domain", function () {
- ContributorsGraph.prototype.y_domain = 30
- var instance = new ContributorsGraph()
- instance.y = d3.scale.linear().range([100, 0]).nice()
- spyOn(instance.y, 'domain')
- instance.set_y_domain()
- expect(instance.y.domain).toHaveBeenCalledWith(30)
- })
- })
-
- describe("#set_domain", function () {
- it("calls set_x_domain and set_y_domain", function () {
- var instance = new ContributorsGraph()
- spyOn(instance, 'set_x_domain')
- spyOn(instance, 'set_y_domain')
- instance.set_domain()
- expect(instance.set_x_domain).toHaveBeenCalled()
- expect(instance.set_y_domain).toHaveBeenCalled()
- })
- })
-
- describe("#set_data", function () {
- it("sets the data", function () {
- var instance = new ContributorsGraph()
- instance.set_data("20")
- expect(instance.data).toEqual("20")
- })
- })
-})
-
-describe("ContributorsMasterGraph", function () {
-
- // TODO: fix or remove
- //describe("#process_dates", function () {
- //it("gets and parses dates", function () {
- //var graph = new ContributorsMasterGraph()
- //var data = 'random data here'
- //spyOn(graph, 'parse_dates')
- //spyOn(graph, 'get_dates').andReturn("get")
- //spyOn(ContributorsGraph,'set_dates').andCallThrough()
- //graph.process_dates(data)
- //expect(graph.parse_dates).toHaveBeenCalledWith(data)
- //expect(graph.get_dates).toHaveBeenCalledWith(data)
- //expect(ContributorsGraph.set_dates).toHaveBeenCalledWith("get")
- //})
- //})
-
- describe("#get_dates", function () {
- it("plucks the date field from data collection", function () {
- var graph = new ContributorsMasterGraph()
- var data = [{date: "2013-01-01"}, {date: "2012-12-15"}]
- expect(graph.get_dates(data)).toEqual(["2013-01-01", "2012-12-15"])
- })
- })
-
- describe("#parse_dates", function () {
- it("parses the dates", function () {
- var graph = new ContributorsMasterGraph()
- var parseDate = d3.time.format("%Y-%m-%d").parse
- var data = [{date: "2013-01-01"}, {date: "2012-12-15"}]
- var correct = [{date: parseDate(data[0].date)}, {date: parseDate(data[1].date)}]
- graph.parse_dates(data)
- expect(data).toEqual(correct)
- })
- })
-
-
-})
diff --git a/spec/javascripts/stat_graph_contributors_util_spec.js b/spec/javascripts/stat_graph_contributors_util_spec.js
deleted file mode 100644
index 9c1b588861d98861651533be5b6bf99fd400ea69..0000000000000000000000000000000000000000
--- a/spec/javascripts/stat_graph_contributors_util_spec.js
+++ /dev/null
@@ -1,208 +0,0 @@
-describe("ContributorsStatGraphUtil", function () {
-
- describe("#parse_log", function () {
- it("returns a correctly parsed log", function () {
- var fake_log = [
- {author_email: "karlo@email.com", author_name: "Karlo Soriano", date: "2013-05-09", additions: 471},
- {author_email: "dzaporozhets@email.com", author_name: "Dmitriy Zaporozhets", date: "2013-05-08", additions: 6, deletions: 1},
- {author_email: "dzaporozhets@email.com", author_name: "Dmitriy Zaporozhets", date: "2013-05-08", additions: 19, deletions: 3},
- {author_email: "dzaporozhets@email.com", author_name: "Dmitriy Zaporozhets", date: "2013-05-08", additions: 29, deletions: 3}]
-
- var correct_parsed_log = {
- total: [
- {date: "2013-05-09", additions: 471, deletions: 0, commits: 1},
- {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}],
- by_author:
- [
- {
- author_name: "Karlo Soriano", author_email: "karlo@email.com",
- "2013-05-09": {date: "2013-05-09", additions: 471, deletions: 0, commits: 1}
- },
- {
- author_name: "Dmitriy Zaporozhets",author_email: "dzaporozhets@email.com",
- "2013-05-08": {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}
- }
- ]
- }
- expect(ContributorsStatGraphUtil.parse_log(fake_log)).toEqual(correct_parsed_log)
- })
- })
-
- describe("#store_data", function () {
-
- var fake_entry = {author: "Karlo Soriano", date: "2013-05-09", additions: 471}
- var fake_total = {}
- var fake_by_author = {}
-
- it("calls #store_commits", function () {
- spyOn(ContributorsStatGraphUtil, 'store_commits')
- ContributorsStatGraphUtil.store_data(fake_entry, fake_total, fake_by_author)
- expect(ContributorsStatGraphUtil.store_commits).toHaveBeenCalled()
- })
-
- it("calls #store_additions", function () {
- spyOn(ContributorsStatGraphUtil, 'store_additions')
- ContributorsStatGraphUtil.store_data(fake_entry, fake_total, fake_by_author)
- expect(ContributorsStatGraphUtil.store_additions).toHaveBeenCalled()
- })
-
- it("calls #store_deletions", function () {
- spyOn(ContributorsStatGraphUtil, 'store_deletions')
- ContributorsStatGraphUtil.store_data(fake_entry, fake_total, fake_by_author)
- expect(ContributorsStatGraphUtil.store_deletions).toHaveBeenCalled()
- })
-
- })
-
- // TODO: fix or remove
- //describe("#store_commits", function () {
- //var fake_total = "fake_total"
- //var fake_by_author = "fake_by_author"
-
- //it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
- //spyOn(ContributorsStatGraphUtil, 'add')
- //ContributorsStatGraphUtil.store_commits(fake_total, fake_by_author)
- //expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "commits", 1], ["fake_by_author", "commits", 1]])
- //})
- //})
-
- describe("#add", function () {
- it("adds 1 to current test_field in collection", function () {
- var fake_collection = {test_field: 10}
- ContributorsStatGraphUtil.add(fake_collection, "test_field", 1)
- expect(fake_collection.test_field).toEqual(11)
- })
-
- it("inits and adds 1 if test_field in collection is not defined", function () {
- var fake_collection = {}
- ContributorsStatGraphUtil.add(fake_collection, "test_field", 1)
- expect(fake_collection.test_field).toEqual(1)
- })
- })
-
- // TODO: fix or remove
- //describe("#store_additions", function () {
- //var fake_entry = {additions: 10}
- //var fake_total= "fake_total"
- //var fake_by_author = "fake_by_author"
- //it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
- //spyOn(ContributorsStatGraphUtil, 'add')
- //ContributorsStatGraphUtil.store_additions(fake_entry, fake_total, fake_by_author)
- //expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "additions", 10], ["fake_by_author", "additions", 10]])
- //})
- //})
-
- // TODO: fix or remove
- //describe("#store_deletions", function () {
- //var fake_entry = {deletions: 10}
- //var fake_total= "fake_total"
- //var fake_by_author = "fake_by_author"
- //it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
- //spyOn(ContributorsStatGraphUtil, 'add')
- //ContributorsStatGraphUtil.store_deletions(fake_entry, fake_total, fake_by_author)
- //expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "deletions", 10], ["fake_by_author", "deletions", 10]])
- //})
- //})
-
- describe("#add_date", function () {
- it("adds a date field to the collection", function () {
- var fake_date = "2013-10-02"
- var fake_collection = {}
- ContributorsStatGraphUtil.add_date(fake_date, fake_collection)
- expect(fake_collection[fake_date].date).toEqual("2013-10-02")
- })
- })
-
- describe("#add_author", function () {
- it("adds an author field to the collection", function () {
- var fake_author = { author_name: "Author", author_email: 'fake@email.com' }
- var fake_collection = {}
- ContributorsStatGraphUtil.add_author(fake_author, fake_collection)
- expect(fake_collection[fake_author.author_name].author_name).toEqual("Author")
- })
- })
-
- describe("#get_total_data", function () {
- it("returns the collection sorted via specified field", function () {
- var fake_parsed_log = {
- total: [{date: "2013-05-09", additions: 471, deletions: 0, commits: 1},
- {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}],
- by_author:[
- {
- author: "Karlo Soriano",
- "2013-05-09": {date: "2013-05-09", additions: 471, deletions: 0, commits: 1}
- },
- {
- author: "Dmitriy Zaporozhets",
- "2013-05-08": {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}
- }
- ]};
- var correct_total_data = [{date: "2013-05-08", commits: 3},
- {date: "2013-05-09", commits: 1}];
- expect(ContributorsStatGraphUtil.get_total_data(fake_parsed_log, "commits")).toEqual(correct_total_data)
- })
- })
-
- describe("#pick_field", function () {
- it("returns the collection with only the specified field and date", function () {
- var fake_parsed_log_total = [{date: "2013-05-09", additions: 471, deletions: 0, commits: 1},
- {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}];
- ContributorsStatGraphUtil.pick_field(fake_parsed_log_total, "commits")
- var correct_pick_field_data = [{date: "2013-05-09", commits: 1},{date: "2013-05-08", commits: 3}];
- expect(ContributorsStatGraphUtil.pick_field(fake_parsed_log_total, "commits")).toEqual(correct_pick_field_data)
- })
- })
-
- describe("#get_author_data", function () {
- it("returns the log by author sorted by specified field", function () {
- var fake_parsed_log = {
- total: [
- {date: "2013-05-09", additions: 471, deletions: 0, commits: 1},
- {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}
- ],
- by_author: [
- {
- author_name: "Karlo Soriano", author_email: "karlo@email.com",
- "2013-05-09": {date: "2013-05-09", additions: 471, deletions: 0, commits: 1}
- },
- {
- author_name: "Dmitriy Zaporozhets", author_email: "dzaporozhets@email.com",
- "2013-05-08": {date: "2013-05-08", additions: 54, deletions: 7, commits: 3}
- }
- ]
- }
- var correct_author_data = [
- {author_name:"Dmitriy Zaporozhets",author_email:"dzaporozhets@email.com",dates:{"2013-05-08":3},deletions:7,additions:54,"commits":3},
- {author_name:"Karlo Soriano",author_email:"karlo@email.com",dates:{"2013-05-09":1},deletions:0,additions:471,commits:1}
- ]
- expect(ContributorsStatGraphUtil.get_author_data(fake_parsed_log, "commits")).toEqual(correct_author_data)
- })
- })
-
- describe("#parse_log_entry", function () {
- it("adds the corresponding info from the log entry to the author", function () {
- var fake_log_entry = { author_name: "Karlo Soriano", author_email: "karlo@email.com",
- "2013-05-09": {date: "2013-05-09", additions: 471, deletions: 0, commits: 1}
- }
- var correct_parsed_log = {author_name:"Karlo Soriano",author_email:"karlo@email.com",dates:{"2013-05-09":1},deletions:0,additions:471,commits:1}
- expect(ContributorsStatGraphUtil.parse_log_entry(fake_log_entry, 'commits', null)).toEqual(correct_parsed_log)
- })
- })
-
- describe("#in_range", function () {
- var date = "2013-05-09"
- it("returns true if date_range is null", function () {
- expect(ContributorsStatGraphUtil.in_range(date, null)).toEqual(true)
- })
- it("returns true if date is in range", function () {
- var date_range = [new Date("2013-01-01"), new Date("2013-12-12")]
- expect(ContributorsStatGraphUtil.in_range(date, date_range)).toEqual(true)
- })
- it("returns false if date is not in range", function () {
- var date_range = [new Date("1999-12-01"), new Date("2000-12-01")]
- expect(ContributorsStatGraphUtil.in_range(date, date_range)).toEqual(false)
- })
- })
-
-
-})
diff --git a/spec/javascripts/stat_graph_spec.js b/spec/javascripts/stat_graph_spec.js
deleted file mode 100644
index b589af34610bb8daacbeafecdfe0bf7d57a57187..0000000000000000000000000000000000000000
--- a/spec/javascripts/stat_graph_spec.js
+++ /dev/null
@@ -1,17 +0,0 @@
-describe("StatGraph", function () {
-
- describe("#get_log", function () {
- it("returns log", function () {
- StatGraph.log = "test";
- expect(StatGraph.get_log()).toBe("test");
- });
- });
-
- describe("#set_log", function () {
- it("sets the log", function () {
- StatGraph.set_log("test");
- expect(StatGraph.log).toBe("test");
- })
- })
-
-});
diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml
deleted file mode 100644
index 9bfa261a356ac0707d3bc959ba99e99b381bf68e..0000000000000000000000000000000000000000
--- a/spec/javascripts/support/jasmine.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-# src_files
-#
-# Return an array of filepaths relative to src_dir to include before jasmine specs.
-# Default: []
-#
-# EXAMPLE:
-#
-# src_files:
-# - lib/source1.js
-# - lib/source2.js
-# - dist/**/*.js
-#
-src_files:
- - assets/application.js
-
-# stylesheets
-#
-# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
-# Default: []
-#
-# EXAMPLE:
-#
-# stylesheets:
-# - css/style.css
-# - stylesheets/*.css
-#
-stylesheets:
- - stylesheets/**/*.css
-
-# helpers
-#
-# Return an array of filepaths relative to spec_dir to include before jasmine specs.
-# Default: ["helpers/**/*.js"]
-#
-# EXAMPLE:
-#
-# helpers:
-# - helpers/**/*.js
-#
-helpers:
- - helpers/**/*.js
-
-# spec_files
-#
-# Return an array of filepaths relative to spec_dir to include.
-# Default: ["**/*[sS]pec.js"]
-#
-# EXAMPLE:
-#
-# spec_files:
-# - **/*[sS]pec.js
-#
-spec_files:
- - '**/*[sS]pec.js'
-
-# src_dir
-#
-# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
-# Default: project root
-#
-# EXAMPLE:
-#
-# src_dir: public
-#
-src_dir:
-
-# spec_dir
-#
-# Spec directory path. Your spec_files must be returned relative to this path.
-# Default: spec/javascripts
-#
-# EXAMPLE:
-#
-# spec_dir: spec/javascripts
-#
-spec_dir: spec/javascripts
diff --git a/spec/javascripts/support/jasmine_helper.rb b/spec/javascripts/support/jasmine_helper.rb
deleted file mode 100644
index b4919802afe405cd727abf936f9b074792bf3d97..0000000000000000000000000000000000000000
--- a/spec/javascripts/support/jasmine_helper.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-#Use this file to set/override Jasmine configuration options
-#You can remove it if you don't need it.
-#This file is loaded *after* jasmine.yml is interpreted.
-#
-#Example: using a different boot file.
-#Jasmine.configure do |config|
-# config.boot_dir = '/absolute/path/to/boot_dir'
-# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
-#end
-#
-
diff --git a/spec/lib/disable_email_interceptor_spec.rb b/spec/lib/disable_email_interceptor_spec.rb
deleted file mode 100644
index 06d5450688baf556d40bec2390f8f93878e6690e..0000000000000000000000000000000000000000
--- a/spec/lib/disable_email_interceptor_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-
-describe DisableEmailInterceptor do
- before do
- ActionMailer::Base.register_interceptor(DisableEmailInterceptor)
- end
-
- it 'should not send emails' do
- allow(Gitlab.config.gitlab).to receive(:email_enabled).and_return(false)
- expect {
- deliver_mail
- }.not_to change(ActionMailer::Base.deliveries, :count)
- end
-
- after do
- # Removing interceptor from the list because unregister_interceptor is
- # implemented in later version of mail gem
- # See: https://github.com/mikel/mail/pull/705
- Mail.class_variable_set(:@@delivery_interceptors, [])
- end
-
- def deliver_mail
- key = create :personal_key
- Notify.new_ssh_key_email(key.id)
- end
-end
diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb
deleted file mode 100644
index ac602eac154bce6b5992dfe8a9149ff445fe2130..0000000000000000000000000000000000000000
--- a/spec/lib/extracts_path_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'spec_helper'
-
-describe ExtractsPath do
- include ExtractsPath
-
- let(:project) { double('project') }
-
- before do
- @project = project
- project.stub(repository: double(ref_names: ['master', 'foo/bar/baz', 'v1.0.0', 'v2.0.0']))
- project.stub(path_with_namespace: 'gitlab/gitlab-ci')
- end
-
- describe '#extract_ref' do
- it "returns an empty pair when no @project is set" do
- @project = nil
- expect(extract_ref('master/CHANGELOG')).to eq(['', ''])
- end
-
- context "without a path" do
- it "extracts a valid branch" do
- expect(extract_ref('master')).to eq(['master', ''])
- end
-
- it "extracts a valid tag" do
- expect(extract_ref('v2.0.0')).to eq(['v2.0.0', ''])
- end
-
- it "extracts a valid commit ref without a path" do
- expect(extract_ref('f4b14494ef6abf3d144c28e4af0c20143383e062')).to eq(
- ['f4b14494ef6abf3d144c28e4af0c20143383e062', '']
- )
- end
-
- it "falls back to a primitive split for an invalid ref" do
- expect(extract_ref('stable')).to eq(['stable', ''])
- end
- end
-
- context "with a path" do
- it "extracts a valid branch" do
- expect(extract_ref('foo/bar/baz/CHANGELOG')).to eq(['foo/bar/baz', 'CHANGELOG'])
- end
-
- it "extracts a valid tag" do
- expect(extract_ref('v2.0.0/CHANGELOG')).to eq(['v2.0.0', 'CHANGELOG'])
- end
-
- it "extracts a valid commit SHA" do
- expect(extract_ref('f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG')).to eq(
- ['f4b14494ef6abf3d144c28e4af0c20143383e062', 'CHANGELOG']
- )
- end
-
- it "falls back to a primitive split for an invalid ref" do
- expect(extract_ref('stable/CHANGELOG')).to eq(['stable', 'CHANGELOG'])
- end
- end
- end
-end
diff --git a/spec/lib/file_size_validator_spec.rb b/spec/lib/file_size_validator_spec.rb
deleted file mode 100644
index 5c89c8547142462c7d1251138df3a1e74cbcd152..0000000000000000000000000000000000000000
--- a/spec/lib/file_size_validator_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::FileSizeValidatorSpec' do
- let(:validator) { FileSizeValidator.new(options) }
- let(:attachment) { AttachmentUploader.new }
- let(:note) { create(:note) }
-
- describe 'options uses an integer' do
- let(:options) { { maximum: 10, attributes: { attachment: attachment } } }
-
- it 'attachment exceeds maximum limit' do
- allow(attachment).to receive(:size) { 100 }
- validator.validate_each(note, :attachment, attachment)
- expect(note.errors).to have_key(:attachment)
- end
-
- it 'attachment under maximum limit' do
- allow(attachment).to receive(:size) { 1 }
- validator.validate_each(note, :attachment, attachment)
- expect(note.errors).not_to have_key(:attachment)
- end
- end
-
- describe 'options uses a symbol' do
- let(:options) { { maximum: :test,
- attributes: { attachment: attachment } } }
- before do
- allow(note).to receive(:test) { 10 }
- end
-
- it 'attachment exceeds maximum limit' do
- allow(attachment).to receive(:size) { 100 }
- validator.validate_each(note, :attachment, attachment)
- expect(note.errors).to have_key(:attachment)
- end
-
- it 'attachment under maximum limit' do
- allow(attachment).to receive(:size) { 1 }
- validator.validate_each(note, :attachment, attachment)
- expect(note.errors).not_to have_key(:attachment)
- end
- end
-end
diff --git a/spec/lib/git_ref_validator_spec.rb b/spec/lib/git_ref_validator_spec.rb
deleted file mode 100644
index 4633b6f3934b9ddf7e00c1cf3ea35e10d3da9f57..0000000000000000000000000000000000000000
--- a/spec/lib/git_ref_validator_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitRefValidator do
- it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy }
- it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy }
- it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy }
- it { expect(Gitlab::GitRefValidator.validate('#1')).to be_truthy }
- it { expect(Gitlab::GitRefValidator.validate('feature/~new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/^new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/:new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/?new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/*new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/[new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/new/')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature/new.')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature\@{')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature\new')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature//new')).to be_falsey }
- it { expect(Gitlab::GitRefValidator.validate('feature new')).to be_falsey }
-end
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
deleted file mode 100644
index 95fc7e16a1102b8838a0395af3eb6fbd54352cd8..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/auth_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Auth do
- let(:gl_auth) { Gitlab::Auth.new }
-
- describe :find do
- let!(:user) do
- create(:user,
- username: username,
- password: password,
- password_confirmation: password)
- end
- let(:username) { 'John' } # username isn't lowercase, test this
- let(:password) { 'my-secret' }
-
- it "should find user by valid login/password" do
- expect( gl_auth.find(username, password) ).to eql user
- end
-
- it 'should find user by valid email/password with case-insensitive email' do
- expect(gl_auth.find(user.email.upcase, password)).to eql user
- end
-
- it 'should find user by valid username/password with case-insensitive username' do
- expect(gl_auth.find(username.upcase, password)).to eql user
- end
-
- it "should not find user with invalid password" do
- password = 'wrong'
- expect( gl_auth.find(username, password) ).to_not eql user
- end
-
- it "should not find user with invalid login" do
- user = 'wrong'
- expect( gl_auth.find(username, password) ).to_not eql user
- end
-
- context "with ldap enabled" do
- before { Gitlab::LDAP::Config.stub(enabled?: true) }
-
- it "tries to autheticate with db before ldap" do
- expect(Gitlab::LDAP::Authentication).not_to receive(:login)
-
- gl_auth.find(username, password)
- end
-
- it "uses ldap as fallback to for authentication" do
- expect(Gitlab::LDAP::Authentication).to receive(:login)
-
- gl_auth.find('ldap_user', 'password')
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/backend/grack_auth_spec.rb b/spec/lib/gitlab/backend/grack_auth_spec.rb
deleted file mode 100644
index d0aad54f677fa11e79a95c897a2689e91ae4de44..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/backend/grack_auth_spec.rb
+++ /dev/null
@@ -1,196 +0,0 @@
-require "spec_helper"
-
-describe Grack::Auth do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
-
- let(:app) { lambda { |env| [200, {}, "Success!"] } }
- let!(:auth) { Grack::Auth.new(app) }
- let(:env) {
- {
- "rack.input" => "",
- "REQUEST_METHOD" => "GET",
- "QUERY_STRING" => "service=git-upload-pack"
- }
- }
- let(:status) { auth.call(env).first }
-
- describe "#call" do
- context "when the project doesn't exist" do
- before do
- env["PATH_INFO"] = "doesnt/exist.git"
- end
-
- context "when no authentication is provided" do
- it "responds with status 401" do
- expect(status).to eq(401)
- end
- end
-
- context "when username and password are provided" do
- context "when authentication fails" do
- before do
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, "nope")
- end
-
- it "responds with status 401" do
- expect(status).to eq(401)
- end
- end
-
- context "when authentication succeeds" do
- before do
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, user.password)
- end
-
- it "responds with status 404" do
- expect(status).to eq(404)
- end
- end
- end
- end
-
- context "when the project exists" do
- before do
- env["PATH_INFO"] = project.path_with_namespace + ".git"
- end
-
- context "when the project is public" do
- before do
- project.update_attribute(:visibility_level, Project::PUBLIC)
- end
-
- it "responds with status 200" do
- expect(status).to eq(200)
- end
- end
-
- context "when the project is private" do
- before do
- project.update_attribute(:visibility_level, Project::PRIVATE)
- end
-
- context "when no authentication is provided" do
- it "responds with status 401" do
- expect(status).to eq(401)
- end
- end
-
- context "when username and password are provided" do
- context "when authentication fails" do
- before do
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, "nope")
- end
-
- it "responds with status 401" do
- expect(status).to eq(401)
- end
-
- context "when the user is IP banned" do
- before do
- expect(Rack::Attack::Allow2Ban).to receive(:filter).and_return(true)
- allow_any_instance_of(Rack::Request).to receive(:ip).and_return('1.2.3.4')
- end
-
- it "responds with status 401" do
- expect(status).to eq(401)
- end
- end
- end
-
- context "when authentication succeeds" do
- before do
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, user.password)
- end
-
- context "when the user has access to the project" do
- before do
- project.team << [user, :master]
- end
-
- context "when the user is blocked" do
- before do
- user.block
- project.team << [user, :master]
- end
-
- it "responds with status 404" do
- expect(status).to eq(404)
- end
- end
-
- context "when the user isn't blocked" do
- before do
- expect(Rack::Attack::Allow2Ban).to receive(:reset)
- end
-
- it "responds with status 200" do
- expect(status).to eq(200)
- end
- end
-
- context "when blank password attempts follow a valid login" do
- let(:options) { Gitlab.config.rack_attack.git_basic_auth }
- let(:maxretry) { options[:maxretry] - 1 }
- let(:ip) { '1.2.3.4' }
-
- before do
- allow_any_instance_of(Rack::Request).to receive(:ip).and_return(ip)
- Rack::Attack::Allow2Ban.reset(ip, options)
- end
-
- after do
- Rack::Attack::Allow2Ban.reset(ip, options)
- end
-
- def attempt_login(include_password)
- password = include_password ? user.password : ""
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, password)
- Grack::Auth.new(app)
- auth.call(env).first
- end
-
- it "repeated attempts followed by successful attempt" do
- for n in 0..maxretry do
- expect(attempt_login(false)).to eq(401)
- end
-
- expect(attempt_login(true)).to eq(200)
- expect(Rack::Attack::Allow2Ban.send(:banned?, ip)).to eq(nil)
-
- for n in 0..maxretry do
- expect(attempt_login(false)).to eq(401)
- end
- end
- end
- end
-
- context "when the user doesn't have access to the project" do
- it "responds with status 404" do
- expect(status).to eq(404)
- end
- end
- end
- end
-
- context "when a gitlab ci token is provided" do
- let(:token) { "123" }
-
- before do
- gitlab_ci_service = project.build_gitlab_ci_service
- gitlab_ci_service.active = true
- gitlab_ci_service.token = token
- gitlab_ci_service.project_url = "http://google.com"
- gitlab_ci_service.save
-
- env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials("gitlab-ci-token", token)
- end
-
- it "responds with status 200" do
- expect(status).to eq(200)
- end
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/backend/rack_attack_helpers_spec.rb b/spec/lib/gitlab/backend/rack_attack_helpers_spec.rb
deleted file mode 100644
index 2ac496fd669a62cb3b48b0dd9377d580a6df8bbf..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/backend/rack_attack_helpers_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require "spec_helper"
-
-describe 'RackAttackHelpers' do
- describe 'reset' do
- let(:discriminator) { 'test-key'}
- let(:maxretry) { 5 }
- let(:period) { 1.minute }
- let(:options) { { findtime: period, bantime: 60, maxretry: maxretry } }
-
- def do_filter
- for i in 1..maxretry - 1 do
- status = Rack::Attack::Allow2Ban.filter(discriminator, options) { true }
- expect(status).to eq(false)
- end
- end
-
- def do_reset
- Rack::Attack::Allow2Ban.reset(discriminator, options)
- end
-
- before do
- do_reset
- end
-
- after do
- do_reset
- end
-
- it 'user is not banned after n - 1 retries' do
- do_filter
- do_reset
- do_filter
- end
- end
-end
diff --git a/spec/lib/gitlab/backend/shell_spec.rb b/spec/lib/gitlab/backend/shell_spec.rb
deleted file mode 100644
index 27279465c1aece0b6f00bccfac48a57520386e9c..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/backend/shell_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Shell do
- let(:project) { double('Project', id: 7, path: 'diaspora') }
- let(:gitlab_shell) { Gitlab::Shell.new }
-
- before do
- Project.stub(find: project)
- end
-
- it { is_expected.to respond_to :add_key }
- it { is_expected.to respond_to :remove_key }
- it { is_expected.to respond_to :add_repository }
- it { is_expected.to respond_to :remove_repository }
- it { is_expected.to respond_to :fork_repository }
-
- it { expect(gitlab_shell.url_to_repo('diaspora')).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + "diaspora.git") }
-end
diff --git a/spec/lib/gitlab/bitbucket_import/client_spec.rb b/spec/lib/gitlab/bitbucket_import/client_spec.rb
deleted file mode 100644
index dd450e9967b338f0b0ffb2929fb1afd1749272c2..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/bitbucket_import/client_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::BitbucketImport::Client do
- let(:token) { '123456' }
- let(:secret) { 'secret' }
- let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) }
-
- before do
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "bitbucket")
- end
-
- it 'all OAuth client options are symbols' do
- client.consumer.options.keys.each do |key|
- expect(key).to be_kind_of(Symbol)
- end
- end
-end
diff --git a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
deleted file mode 100644
index 0ec6a43f681c6eb93636eea8c2af093d79fcd518..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::BitbucketImport::ProjectCreator do
- let(:user) { create(:user, bitbucket_access_token: "asdffg", bitbucket_access_token_secret: "sekret") }
- let(:repo) { {
- name: 'Vim',
- slug: 'vim',
- is_private: true,
- owner: "asd"}.with_indifferent_access
- }
- let(:namespace){ create(:group, owner: user) }
-
- before do
- namespace.add_owner(user)
- end
-
- it 'creates project' do
- allow_any_instance_of(Project).to receive(:add_import_job)
-
- project_creator = Gitlab::BitbucketImport::ProjectCreator.new(repo, namespace, user)
- project = project_creator.execute
-
- expect(project.import_url).to eq("ssh://git@bitbucket.org/asd/vim.git")
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-end
diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb
deleted file mode 100644
index cb7b0fbb8902ae4b9504de7323bfe5312b879d56..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/closing_issue_extractor_spec.rb
+++ /dev/null
@@ -1,176 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::ClosingIssueExtractor do
- let(:project) { create(:project) }
- let(:issue) { create(:issue, project: project) }
- let(:iid1) { issue.iid }
-
- subject { described_class.new(project, project.creator) }
-
- describe "#closed_by_message" do
- context 'with a single reference' do
- it do
- message = "Awesome commit (Closes ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Awesome commit (closes ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Closed ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "closed ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Closing ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "closing ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Close ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "close ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Awesome commit (Fixes ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Awesome commit (fixes ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Fixed ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "fixed ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Fixing ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "fixing ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Fix ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "fix ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Awesome commit (Resolves ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Awesome commit (resolves ##{iid1})"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Resolved ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "resolved ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Resolving ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "resolving ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "Resolve ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
-
- it do
- message = "resolve ##{iid1}"
- expect(subject.closed_by_message(message)).to eq([issue])
- end
- end
-
- context 'with multiple references' do
- let(:other_issue) { create(:issue, project: project) }
- let(:third_issue) { create(:issue, project: project) }
- let(:iid2) { other_issue.iid }
- let(:iid3) { third_issue.iid }
-
- it 'fetches issues in single line message' do
- message = "Closes ##{iid1} and fix ##{iid2}"
-
- expect(subject.closed_by_message(message)).
- to eq([issue, other_issue])
- end
-
- it 'fetches comma-separated issues references in single line message' do
- message = "Closes ##{iid1}, closes ##{iid2}"
-
- expect(subject.closed_by_message(message)).
- to eq([issue, other_issue])
- end
-
- it 'fetches comma-separated issues numbers in single line message' do
- message = "Closes ##{iid1}, ##{iid2} and ##{iid3}"
-
- expect(subject.closed_by_message(message)).
- to eq([issue, other_issue, third_issue])
- end
-
- it 'fetches issues in multi-line message' do
- message = "Awesome commit (closes ##{iid1})\nAlso fixes ##{iid2}"
-
- expect(subject.closed_by_message(message)).
- to eq([issue, other_issue])
- end
-
- it 'fetches issues in hybrid message' do
- message = "Awesome commit (closes ##{iid1})\n"\
- "Also fixing issues ##{iid2}, ##{iid3} and #4"
-
- expect(subject.closed_by_message(message)).
- to eq([issue, other_issue, third_issue])
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb
deleted file mode 100644
index 40eb45e37cafd9348b73200e5893312c01889672..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/diff/file_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Diff::File do
- include RepoHelpers
-
- let(:project) { create(:project) }
- let(:commit) { project.repository.commit(sample_commit.id) }
- let(:diff) { commit.diffs.first }
- let(:diff_file) { Gitlab::Diff::File.new(diff) }
-
- describe :diff_lines do
- let(:diff_lines) { diff_file.diff_lines }
-
- it { expect(diff_lines.size).to eq(30) }
- it { expect(diff_lines.first).to be_kind_of(Gitlab::Diff::Line) }
- end
-
- describe :mode_changed? do
- it { expect(diff_file.mode_changed?).to be_falsey }
- end
-end
diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb
deleted file mode 100644
index 918f6d0ead4f11b408d30f4fb06918558cdcdd30..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/diff/parser_spec.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Diff::Parser do
- include RepoHelpers
-
- let(:project) { create(:project) }
- let(:commit) { project.repository.commit(sample_commit.id) }
- let(:diff) { commit.diffs.first }
- let(:parser) { Gitlab::Diff::Parser.new }
-
- describe :parse do
- let(:diff) do
- < path }
-- options = { chdir: path }
-+
-+ vars = {
-+ "PWD" => path
-+ }
-+
-+ options = {
-+ chdir: path
-+ }
-
- unless File.directory?(path)
- FileUtils.mkdir_p(path)
-@@ -19,6 +25,7 @@ module Popen
-
- @cmd_output = ""
- @cmd_status = 0
-+
- Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
- @cmd_output << stdout.read
- @cmd_output << stderr.read
-eos
- end
-
- before do
- @lines = parser.parse(diff.lines)
- end
-
- it { expect(@lines.size).to eq(30) }
-
- describe 'lines' do
- describe 'first line' do
- let(:line) { @lines.first }
-
- it { expect(line.type).to eq('match') }
- it { expect(line.old_pos).to eq(6) }
- it { expect(line.new_pos).to eq(6) }
- it { expect(line.text).to eq('@@ -6,12 +6,18 @@ module Popen') }
- end
-
- describe 'removal line' do
- let(:line) { @lines[10] }
-
- it { expect(line.type).to eq('old') }
- it { expect(line.old_pos).to eq(14) }
- it { expect(line.new_pos).to eq(13) }
- it { expect(line.text).to eq('- options = { chdir: path }') }
- end
-
- describe 'addition line' do
- let(:line) { @lines[16] }
-
- it { expect(line.type).to eq('new') }
- it { expect(line.old_pos).to eq(15) }
- it { expect(line.new_pos).to eq(18) }
- it { expect(line.text).to eq('+ options = {') }
- end
-
- describe 'unchanged line' do
- let(:line) { @lines.last }
-
- it { expect(line.type).to eq(nil) }
- it { expect(line.old_pos).to eq(24) }
- it { expect(line.new_pos).to eq(31) }
- it { expect(line.text).to eq(' @cmd_output << stderr.read') }
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
deleted file mode 100644
index 39be9d646442c761595f5ef28952d97315558515..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/git_access_spec.rb
+++ /dev/null
@@ -1,235 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitAccess do
- let(:access) { Gitlab::GitAccess.new(actor, project) }
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:actor) { user }
-
- describe 'can_push_to_branch?' do
- describe 'push to none protected branch' do
- it "returns true if user is a master" do
- project.team << [user, :master]
- expect(access.can_push_to_branch?("random_branch")).to be_truthy
- end
-
- it "returns true if user is a developer" do
- project.team << [user, :developer]
- expect(access.can_push_to_branch?("random_branch")).to be_truthy
- end
-
- it "returns false if user is a reporter" do
- project.team << [user, :reporter]
- expect(access.can_push_to_branch?("random_branch")).to be_falsey
- end
- end
-
- describe 'push to protected branch' do
- before do
- @branch = create :protected_branch, project: project
- end
-
- it "returns true if user is a master" do
- project.team << [user, :master]
- expect(access.can_push_to_branch?(@branch.name)).to be_truthy
- end
-
- it "returns false if user is a developer" do
- project.team << [user, :developer]
- expect(access.can_push_to_branch?(@branch.name)).to be_falsey
- end
-
- it "returns false if user is a reporter" do
- project.team << [user, :reporter]
- expect(access.can_push_to_branch?(@branch.name)).to be_falsey
- end
- end
-
- describe 'push to protected branch if allowed for developers' do
- before do
- @branch = create :protected_branch, project: project, developers_can_push: true
- end
-
- it "returns true if user is a master" do
- project.team << [user, :master]
- expect(access.can_push_to_branch?(@branch.name)).to be_truthy
- end
-
- it "returns true if user is a developer" do
- project.team << [user, :developer]
- expect(access.can_push_to_branch?(@branch.name)).to be_truthy
- end
-
- it "returns false if user is a reporter" do
- project.team << [user, :reporter]
- expect(access.can_push_to_branch?(@branch.name)).to be_falsey
- end
- end
-
- end
-
- describe 'download_access_check' do
- describe 'master permissions' do
- before { project.team << [user, :master] }
-
- context 'pull code' do
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_truthy }
- end
- end
-
- describe 'guest permissions' do
- before { project.team << [user, :guest] }
-
- context 'pull code' do
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_falsey }
- end
- end
-
- describe 'blocked user' do
- before do
- project.team << [user, :master]
- user.block
- end
-
- context 'pull code' do
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_falsey }
- end
- end
-
- describe 'without acccess to project' do
- context 'pull code' do
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_falsey }
- end
- end
-
- describe 'deploy key permissions' do
- let(:key) { create(:deploy_key) }
- let(:actor) { key }
-
- context 'pull code' do
- context 'allowed' do
- before { key.projects << project }
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_truthy }
- end
-
- context 'denied' do
- subject { access.download_access_check }
-
- it { expect(subject.allowed?).to be_falsey }
- end
- end
- end
- end
-
- describe 'push_access_check' do
- def protect_feature_branch
- create(:protected_branch, name: 'feature', project: project)
- end
-
- def changes
- {
- push_new_branch: "#{Gitlab::Git::BLANK_SHA} 570e7b2ab refs/heads/wow",
- push_master: '6f6d7e7ed 570e7b2ab refs/heads/master',
- push_protected_branch: '6f6d7e7ed 570e7b2ab refs/heads/feature',
- push_remove_protected_branch: "570e7b2ab #{Gitlab::Git::BLANK_SHA} "\
- 'refs/heads/feature',
- push_tag: '6f6d7e7ed 570e7b2ab refs/tags/v1.0.0',
- push_new_tag: "#{Gitlab::Git::BLANK_SHA} 570e7b2ab refs/tags/v7.8.9",
- push_all: ['6f6d7e7ed 570e7b2ab refs/heads/master', '6f6d7e7ed 570e7b2ab refs/heads/feature']
- }
- end
-
- def self.permissions_matrix
- {
- master: {
- push_new_branch: true,
- push_master: true,
- push_protected_branch: true,
- push_remove_protected_branch: false,
- push_tag: true,
- push_new_tag: true,
- push_all: true,
- },
-
- developer: {
- push_new_branch: true,
- push_master: true,
- push_protected_branch: false,
- push_remove_protected_branch: false,
- push_tag: false,
- push_new_tag: true,
- push_all: false,
- },
-
- reporter: {
- push_new_branch: false,
- push_master: false,
- push_protected_branch: false,
- push_remove_protected_branch: false,
- push_tag: false,
- push_new_tag: false,
- push_all: false,
- },
-
- guest: {
- push_new_branch: false,
- push_master: false,
- push_protected_branch: false,
- push_remove_protected_branch: false,
- push_tag: false,
- push_new_tag: false,
- push_all: false,
- }
- }
- end
-
- def self.updated_permissions_matrix
- updated_permissions_matrix = permissions_matrix.dup
- updated_permissions_matrix[:developer][:push_protected_branch] = true
- updated_permissions_matrix[:developer][:push_all] = true
- updated_permissions_matrix
- end
-
- permissions_matrix.keys.each do |role|
- describe "#{role} access" do
- before { protect_feature_branch }
- before { project.team << [user, role] }
-
- permissions_matrix[role].each do |action, allowed|
- context action do
- subject { access.push_access_check(changes[action]) }
-
- it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey }
- end
- end
- end
- end
-
- context "with enabled developers push to protected branches " do
- updated_permissions_matrix.keys.each do |role|
- describe "#{role} access" do
- before { create(:protected_branch, name: 'feature', developers_can_push: true, project: project) }
- before { project.team << [user, role] }
-
- updated_permissions_matrix[role].each do |action, allowed|
- context action do
- subject { access.push_access_check(changes[action]) }
-
- it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey }
- end
- end
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb
deleted file mode 100644
index 4cb91094cb3bf0bda9ff4352a3a4237e9c90d089..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/git_access_wiki_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitAccessWiki do
- let(:access) { Gitlab::GitAccessWiki.new(user, project) }
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- describe 'push_allowed?' do
- before do
- create(:protected_branch, name: 'master', project: project)
- project.team << [user, :developer]
- end
-
- subject { access.push_access_check(changes) }
-
- it { expect(subject.allowed?).to be_truthy }
- end
-
- def changes
- ['6f6d7e7ed 570e7b2ab refs/heads/master']
- end
-end
diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb
deleted file mode 100644
index 26618120316ace4d5aef3ddf6eab3f5b7d546a21..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/github_import/client_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GithubImport::Client do
- let(:token) { '123456' }
- let(:client) { Gitlab::GithubImport::Client.new(token) }
-
- before do
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "github")
- end
-
- it 'all OAuth2 client options are symbols' do
- client.client.options.keys.each do |key|
- expect(key).to be_kind_of(Symbol)
- end
- end
-end
diff --git a/spec/lib/gitlab/github_import/project_creator_spec.rb b/spec/lib/gitlab/github_import/project_creator_spec.rb
deleted file mode 100644
index 3bf52cb685eae7326329a3dd5b3bd37765827909..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/github_import/project_creator_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GithubImport::ProjectCreator do
- let(:user) { create(:user, github_access_token: "asdffg") }
- let(:repo) { OpenStruct.new(
- login: 'vim',
- name: 'vim',
- private: true,
- full_name: 'asd/vim',
- clone_url: "https://gitlab.com/asd/vim.git",
- owner: OpenStruct.new(login: "john"))
- }
- let(:namespace){ create(:group, owner: user) }
-
- before do
- namespace.add_owner(user)
- end
-
- it 'creates project' do
- allow_any_instance_of(Project).to receive(:add_import_job)
-
- project_creator = Gitlab::GithubImport::ProjectCreator.new(repo, namespace, user)
- project = project_creator.execute
-
- expect(project.import_url).to eq("https://asdffg@gitlab.com/asd/vim.git")
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-end
diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb
deleted file mode 100644
index c511c51547409ac98519b97c4b4de59159c4d139..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/gitlab_import/client_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitlabImport::Client do
- let(:token) { '123456' }
- let(:client) { Gitlab::GitlabImport::Client.new(token) }
-
- before do
- Gitlab.config.omniauth.providers << OpenStruct.new(app_id: "asd123", app_secret: "asd123", name: "gitlab")
- end
-
- it 'all OAuth2 client options are symbols' do
- client.client.options.keys.each do |key|
- expect(key).to be_kind_of(Symbol)
- end
- end
-end
diff --git a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb
deleted file mode 100644
index 3cefe4ea8e2058d29df8014139b9d04ebdbecc44..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitlabImport::ProjectCreator do
- let(:user) { create(:user, gitlab_access_token: "asdffg") }
- let(:repo) { {
- name: 'vim',
- path: 'vim',
- visibility_level: Gitlab::VisibilityLevel::PRIVATE,
- path_with_namespace: 'asd/vim',
- http_url_to_repo: "https://gitlab.com/asd/vim.git",
- owner: {name: "john"}}.with_indifferent_access
- }
- let(:namespace){ create(:group, owner: user) }
-
- before do
- namespace.add_owner(user)
- end
-
- it 'creates project' do
- allow_any_instance_of(Project).to receive(:add_import_job)
-
- project_creator = Gitlab::GitlabImport::ProjectCreator.new(repo, namespace, user)
- project = project_creator.execute
-
- expect(project.import_url).to eq("https://oauth2:asdffg@gitlab.com/asd/vim.git")
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-end
diff --git a/spec/lib/gitlab/gitlab_markdown_helper_spec.rb b/spec/lib/gitlab/gitlab_markdown_helper_spec.rb
deleted file mode 100644
index ab613193f41de7f355312961204c7aafc1d8074f..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/gitlab_markdown_helper_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::MarkdownHelper do
- describe '#markup?' do
- %w(textile rdoc org creole wiki
- mediawiki rst adoc asciidoc asc).each do |type|
- it "returns true for #{type} files" do
- expect(Gitlab::MarkdownHelper.markup?("README.#{type}")).to be_truthy
- end
- end
-
- it 'returns false when given a non-markup filename' do
- expect(Gitlab::MarkdownHelper.markup?('README.rb')).not_to be_truthy
- end
- end
-
- describe '#gitlab_markdown?' do
- %w(mdown md markdown).each do |type|
- it "returns true for #{type} files" do
- expect(Gitlab::MarkdownHelper.gitlab_markdown?("README.#{type}")).to be_truthy
- end
- end
-
- it 'returns false when given a non-markdown filename' do
- expect(Gitlab::MarkdownHelper.gitlab_markdown?('README.rb')).not_to be_truthy
- end
- end
-end
diff --git a/spec/lib/gitlab/gitorious_import/project_creator_spec.rb b/spec/lib/gitlab/gitorious_import/project_creator_spec.rb
deleted file mode 100644
index c1125ca63574849b61f7112480ab9e45cd731a52..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/gitorious_import/project_creator_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GitoriousImport::ProjectCreator do
- let(:user) { create(:user) }
- let(:repo) { Gitlab::GitoriousImport::Repository.new('foo/bar-baz-qux') }
- let(:namespace){ create(:group, owner: user) }
-
- before do
- namespace.add_owner(user)
- end
-
- it 'creates project' do
- allow_any_instance_of(Project).to receive(:add_import_job)
-
- project_creator = Gitlab::GitoriousImport::ProjectCreator.new(repo, namespace, user)
- project = project_creator.execute
-
- expect(project.name).to eq("Bar Baz Qux")
- expect(project.path).to eq("bar-baz-qux")
- expect(project.namespace).to eq(namespace)
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
- expect(project.import_type).to eq("gitorious")
- expect(project.import_source).to eq("foo/bar-baz-qux")
- expect(project.import_url).to eq("https://gitorious.org/foo/bar-baz-qux.git")
- end
-end
diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb
deleted file mode 100644
index d2bf871daa8bd1133375669d7a6e53c61258490d..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/google_code_import/client_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require "spec_helper"
-
-describe Gitlab::GoogleCodeImport::Client do
- let(:raw_data) { JSON.parse(File.read(Rails.root.join("spec/fixtures/GoogleCodeProjectHosting.json"))) }
- subject { described_class.new(raw_data) }
-
- describe "#valid?" do
- context "when the data is valid" do
- it "returns true" do
- expect(subject).to be_valid
- end
- end
-
- context "when the data is invalid" do
- let(:raw_data) { "No clue" }
-
- it "returns true" do
- expect(subject).to_not be_valid
- end
- end
- end
-
- describe "#repos" do
- it "returns only Git repositories" do
- expect(subject.repos.length).to eq(1)
- end
- end
-
- describe "#repo" do
- it "returns the referenced repository" do
- expect(subject.repo("tint2").name).to eq("tint2")
- end
- end
-end
diff --git a/spec/lib/gitlab/google_code_import/project_creator_spec.rb b/spec/lib/gitlab/google_code_import/project_creator_spec.rb
deleted file mode 100644
index 7a224538b8be40c732f4f258a09a4318bc72c305..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/google_code_import/project_creator_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GoogleCodeImport::ProjectCreator do
- let(:user) { create(:user) }
- let(:repo) {
- Gitlab::GoogleCodeImport::Repository.new(
- "name" => 'vim',
- "summary" => 'VI Improved',
- "repositoryUrls" => [ "https://vim.googlecode.com/git/" ]
- )
- }
- let(:namespace){ create(:group, owner: user) }
-
- before do
- namespace.add_owner(user)
- end
-
- it 'creates project' do
- allow_any_instance_of(Project).to receive(:add_import_job)
-
- project_creator = Gitlab::GoogleCodeImport::ProjectCreator.new(repo, namespace, user)
- project = project_creator.execute
-
- expect(project.import_url).to eq("https://vim.googlecode.com/git/")
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
-end
diff --git a/spec/lib/gitlab/key_fingerprint_spec.rb b/spec/lib/gitlab/key_fingerprint_spec.rb
deleted file mode 100644
index 266eab6e7932351a7372795cb29fdcc24f4eeefe..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/key_fingerprint_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "spec_helper"
-
-describe Gitlab::KeyFingerprint do
- let(:key) { "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" }
- let(:fingerprint) { "3f:a2:ee:de:b5:de:53:c3:aa:2f:9c:45:24:4c:47:7b" }
-
- describe "#fingerprint" do
- it "generates the key's fingerprint" do
- expect(Gitlab::KeyFingerprint.new(key).fingerprint).to eq(fingerprint)
- end
- end
-end
diff --git a/spec/lib/gitlab/ldap/access_spec.rb b/spec/lib/gitlab/ldap/access_spec.rb
deleted file mode 100644
index 707a0521ab3a0a670c0ba5156ca7ad1d2f4b5aab..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/ldap/access_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP::Access do
- let(:access) { Gitlab::LDAP::Access.new user }
- let(:user) { create(:omniauth_user) }
-
- describe :allowed? do
- subject { access.allowed? }
-
- context 'when the user cannot be found' do
- before { Gitlab::LDAP::Person.stub(find_by_dn: nil) }
-
- it { is_expected.to be_falsey }
- end
-
- context 'when the user is found' do
- before { Gitlab::LDAP::Person.stub(find_by_dn: :ldap_user) }
-
- context 'and the user is diabled via active directory' do
- before { Gitlab::LDAP::Person.stub(disabled_via_active_directory?: true) }
-
- it { is_expected.to be_falsey }
-
- it "should block user in GitLab" do
- access.allowed?
- user.should be_blocked
- end
- end
-
- context 'and has no disabled flag in active diretory' do
- before do
- user.block
-
- Gitlab::LDAP::Person.stub(disabled_via_active_directory?: false)
- end
-
- it { is_expected.to be_truthy }
-
- it "should unblock user in GitLab" do
- access.allowed?
- user.should_not be_blocked
- end
- end
-
- context 'without ActiveDirectory enabled' do
- before do
- Gitlab::LDAP::Config.stub(enabled?: true)
- Gitlab::LDAP::Config.any_instance.stub(active_directory: false)
- end
-
- it { is_expected.to be_truthy }
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/ldap/adapter_spec.rb b/spec/lib/gitlab/ldap/adapter_spec.rb
deleted file mode 100644
index b609e4b38f21c28c21445bded0723288922e1906..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/ldap/adapter_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP::Adapter do
- let(:adapter) { Gitlab::LDAP::Adapter.new 'ldapmain' }
-
- describe :dn_matches_filter? do
- let(:ldap) { double(:ldap) }
- subject { adapter.dn_matches_filter?(:dn, :filter) }
- before { adapter.stub(ldap: ldap) }
-
- context "when the search is successful" do
- context "and the result is non-empty" do
- before { ldap.stub(search: [:foo]) }
-
- it { is_expected.to be_truthy }
- end
-
- context "and the result is empty" do
- before { ldap.stub(search: []) }
-
- it { is_expected.to be_falsey }
- end
- end
-
- context "when the search encounters an error" do
- before { ldap.stub(search: nil, get_operation_result: double(code: 1, message: 'some error')) }
-
- it { is_expected.to be_falsey }
- end
- end
-end
diff --git a/spec/lib/gitlab/ldap/authentication_spec.rb b/spec/lib/gitlab/ldap/authentication_spec.rb
deleted file mode 100644
index 8afc2b21f467ac848fadfea567ff32f3a2f27c39..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/ldap/authentication_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP::Authentication do
- let(:klass) { Gitlab::LDAP::Authentication }
- let(:user) { create(:omniauth_user, extern_uid: dn) }
- let(:dn) { 'uid=john,ou=people,dc=example,dc=com' }
- let(:login) { 'john' }
- let(:password) { 'password' }
-
- describe :login do
- let(:adapter) { double :adapter }
- before do
- Gitlab::LDAP::Config.stub(enabled?: true)
- end
-
- it "finds the user if authentication is successful" do
- user
- # try only to fake the LDAP call
- klass.any_instance.stub(adapter: double(:adapter,
- bind_as: double(:ldap_user, dn: dn)
- ))
- expect(klass.login(login, password)).to be_truthy
- end
-
- it "is false if the user does not exist" do
- # try only to fake the LDAP call
- klass.any_instance.stub(adapter: double(:adapter,
- bind_as: double(:ldap_user, dn: dn)
- ))
- expect(klass.login(login, password)).to be_falsey
- end
-
- it "is false if authentication fails" do
- user
- # try only to fake the LDAP call
- klass.any_instance.stub(adapter: double(:adapter, bind_as: nil))
- expect(klass.login(login, password)).to be_falsey
- end
-
- it "fails if ldap is disabled" do
- Gitlab::LDAP::Config.stub(enabled?: false)
- expect(klass.login(login, password)).to be_falsey
- end
-
- it "fails if no login is supplied" do
- expect(klass.login('', password)).to be_falsey
- end
-
- it "fails if no password is supplied" do
- expect(klass.login(login, '')).to be_falsey
- end
- end
-end
\ No newline at end of file
diff --git a/spec/lib/gitlab/ldap/config_spec.rb b/spec/lib/gitlab/ldap/config_spec.rb
deleted file mode 100644
index 00e9076c787b18e64a9b3f39a6e685ca5f4786f8..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/ldap/config_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP::Config do
- let(:config) { Gitlab::LDAP::Config.new provider }
- let(:provider) { 'ldapmain' }
-
- describe '#initalize' do
- it 'requires a provider' do
- expect{ Gitlab::LDAP::Config.new }.to raise_error ArgumentError
- end
-
- it "works" do
- expect(config).to be_a described_class
- end
-
- it "raises an error if a unknow provider is used" do
- expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error
- end
- end
-end
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
deleted file mode 100644
index 42015c28c81ab6cb64695624c790a6522559d94e..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/ldap/user_spec.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP::User do
- let(:ldap_user) { Gitlab::LDAP::User.new(auth_hash) }
- let(:gl_user) { ldap_user.gl_user }
- let(:info) do
- {
- name: 'John',
- email: 'john@example.com',
- nickname: 'john'
- }
- end
- let(:auth_hash) do
- double(uid: 'my-uid', provider: 'ldapmain', info: double(info))
- end
-
- describe :changed? do
- it "marks existing ldap user as changed" do
- existing_user = create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')
- expect(ldap_user.changed?).to be_truthy
- end
-
- it "marks existing non-ldap user if the email matches as changed" do
- existing_user = create(:user, email: 'john@example.com')
- expect(ldap_user.changed?).to be_truthy
- end
-
- it "dont marks existing ldap user as changed" do
- existing_user = create(:omniauth_user, email: 'john@example.com', extern_uid: 'my-uid', provider: 'ldapmain')
- expect(ldap_user.changed?).to be_falsey
- end
- end
-
- describe :find_or_create do
- it "finds the user if already existing" do
- existing_user = create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')
-
- expect{ ldap_user.save }.to_not change{ User.count }
- end
-
- it "connects to existing non-ldap user if the email matches" do
- existing_user = create(:omniauth_user, email: 'john@example.com', provider: "twitter")
- expect{ ldap_user.save }.to_not change{ User.count }
-
- existing_user.reload
- expect(existing_user.ldap_identity.extern_uid).to eql 'my-uid'
- expect(existing_user.ldap_identity.provider).to eql 'ldapmain'
- end
-
- it "creates a new user if not found" do
- expect{ ldap_user.save }.to change{ User.count }.by(1)
- end
- end
-
-
- describe 'blocking' do
- context 'signup' do
- context 'dont block on create' do
- before { Gitlab::LDAP::Config.any_instance.stub block_auto_created_users: false }
-
- it do
- ldap_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
-
- context 'block on create' do
- before { Gitlab::LDAP::Config.any_instance.stub block_auto_created_users: true }
-
- it do
- ldap_user.save
- expect(gl_user).to be_valid
- expect(gl_user).to be_blocked
- end
- end
- end
-
- context 'sign-in' do
- before do
- ldap_user.save
- ldap_user.gl_user.activate
- end
-
- context 'dont block on create' do
- before { Gitlab::LDAP::Config.any_instance.stub block_auto_created_users: false }
-
- it do
- ldap_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
-
- context 'block on create' do
- before { Gitlab::LDAP::Config.any_instance.stub block_auto_created_users: true }
-
- it do
- ldap_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/note_data_builder_spec.rb b/spec/lib/gitlab/note_data_builder_spec.rb
deleted file mode 100644
index 448cd0c6880dcd58c23174cc62de6deec7453c2a..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/note_data_builder_spec.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::NoteDataBuilder' do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:data) { Gitlab::NoteDataBuilder.build(note, user) }
- let(:note_url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
- let(:fixed_time) { Time.at(1425600000) } # Avoid time precision errors
-
- before(:each) do
- expect(data).to have_key(:object_attributes)
- expect(data[:object_attributes]).to have_key(:url)
- expect(data[:object_attributes][:url]).to eq(note_url)
- expect(data[:object_kind]).to eq('note')
- expect(data[:user]).to eq(user.hook_attrs)
- end
-
- describe 'When asking for a note on commit' do
- let(:note) { create(:note_on_commit) }
-
- it 'returns the note and commit-specific data' do
- expect(data).to have_key(:commit)
- end
- end
-
- describe 'When asking for a note on commit diff' do
- let(:note) { create(:note_on_commit_diff) }
-
- it 'returns the note and commit-specific data' do
- expect(data).to have_key(:commit)
- end
- end
-
- describe 'When asking for a note on issue' do
- let(:issue) { create(:issue, created_at: fixed_time, updated_at: fixed_time) }
- let(:note) { create(:note_on_issue, noteable_id: issue.id) }
-
- it 'returns the note and issue-specific data' do
- expect(data).to have_key(:issue)
- expect(data[:issue]).to eq(issue.hook_attrs)
- end
- end
-
- describe 'When asking for a note on merge request' do
- let(:merge_request) { create(:merge_request, created_at: fixed_time, updated_at: fixed_time) }
- let(:note) { create(:note_on_merge_request, noteable_id: merge_request.id) }
-
- it 'returns the note and merge request data' do
- expect(data).to have_key(:merge_request)
- expect(data[:merge_request]).to eq(merge_request.hook_attrs)
- end
- end
-
- describe 'When asking for a note on merge request diff' do
- let(:merge_request) { create(:merge_request, created_at: fixed_time, updated_at: fixed_time) }
- let(:note) { create(:note_on_merge_request_diff, noteable_id: merge_request.id) }
-
- it 'returns the note and merge request diff data' do
- expect(data).to have_key(:merge_request)
- expect(data[:merge_request]).to eq(merge_request.hook_attrs)
- end
- end
-
- describe 'When asking for a note on project snippet' do
- let!(:snippet) { create(:project_snippet, created_at: fixed_time, updated_at: fixed_time) }
- let!(:note) { create(:note_on_project_snippet, noteable_id: snippet.id) }
-
- it 'returns the note and project snippet data' do
- expect(data).to have_key(:snippet)
- expect(data[:snippet]).to eq(snippet.hook_attrs)
- end
- end
-end
diff --git a/spec/lib/gitlab/o_auth/auth_hash_spec.rb b/spec/lib/gitlab/o_auth/auth_hash_spec.rb
deleted file mode 100644
index 5eb77b492b2c1c0357da42f3c353d80a62aa3e6b..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/o_auth/auth_hash_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::OAuth::AuthHash do
- let(:auth_hash) do
- Gitlab::OAuth::AuthHash.new(double({
- provider: 'twitter',
- uid: uid,
- info: double(info_hash)
- }))
- end
- let(:uid) { 'my-uid' }
- let(:email) { 'my-email@example.com' }
- let(:nickname) { 'my-nickname' }
- let(:info_hash) {
- {
- email: email,
- nickname: nickname,
- name: 'John',
- first_name: "John",
- last_name: "Who"
- }
- }
-
- context "defaults" do
- it { expect(auth_hash.provider).to eql 'twitter' }
- it { expect(auth_hash.uid).to eql uid }
- it { expect(auth_hash.email).to eql email }
- it { expect(auth_hash.username).to eql nickname }
- it { expect(auth_hash.name).to eql "John" }
- it { expect(auth_hash.password).to_not be_empty }
- end
-
- context "email not provided" do
- before { info_hash.delete(:email) }
- it "generates a temp email" do
- expect( auth_hash.email).to start_with('temp-email-for-oauth')
- end
- end
-
- context "username not provided" do
- before { info_hash.delete(:nickname) }
-
- it "takes the first part of the email as username" do
- expect( auth_hash.username ).to eql "my-email"
- end
- end
-
- context "name not provided" do
- before { info_hash.delete(:name) }
-
- it "concats first and lastname as the name" do
- expect( auth_hash.name ).to eql "John Who"
- end
- end
-end
\ No newline at end of file
diff --git a/spec/lib/gitlab/o_auth/user_spec.rb b/spec/lib/gitlab/o_auth/user_spec.rb
deleted file mode 100644
index 44cdd1e4fab191ee3d8f90166c3e6274b5131e9d..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/o_auth/user_spec.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::OAuth::User do
- let(:oauth_user) { Gitlab::OAuth::User.new(auth_hash) }
- let(:gl_user) { oauth_user.gl_user }
- let(:uid) { 'my-uid' }
- let(:provider) { 'my-provider' }
- let(:auth_hash) { double(uid: uid, provider: provider, info: double(info_hash)) }
- let(:info_hash) do
- {
- nickname: '-john+gitlab-ETC%.git@gmail.com',
- name: 'John',
- email: 'john@mail.com'
- }
- end
-
- describe :persisted? do
- let!(:existing_user) { create(:omniauth_user, extern_uid: 'my-uid', provider: 'my-provider') }
-
- it "finds an existing user based on uid and provider (facebook)" do
- auth = double(info: double(name: 'John'), uid: 'my-uid', provider: 'my-provider')
- expect( oauth_user.persisted? ).to be_truthy
- end
-
- it "returns false if use is not found in database" do
- auth_hash.stub(uid: 'non-existing')
- expect( oauth_user.persisted? ).to be_falsey
- end
- end
-
- describe :save do
- let(:provider) { 'twitter' }
-
- describe 'signup' do
- context "with allow_single_sign_on enabled" do
- before { Gitlab.config.omniauth.stub allow_single_sign_on: true }
-
- it "creates a user from Omniauth" do
- oauth_user.save
-
- expect(gl_user).to be_valid
- identity = gl_user.identities.first
- expect(identity.extern_uid).to eql uid
- expect(identity.provider).to eql 'twitter'
- end
- end
-
- context "with allow_single_sign_on disabled (Default)" do
- it "throws an error" do
- expect{ oauth_user.save }.to raise_error StandardError
- end
- end
- end
-
- describe 'blocking' do
- let(:provider) { 'twitter' }
- before { Gitlab.config.omniauth.stub allow_single_sign_on: true }
-
- context 'signup' do
- context 'dont block on create' do
- before { Gitlab.config.omniauth.stub block_auto_created_users: false }
-
- it do
- oauth_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
-
- context 'block on create' do
- before { Gitlab.config.omniauth.stub block_auto_created_users: true }
-
- it do
- oauth_user.save
- expect(gl_user).to be_valid
- expect(gl_user).to be_blocked
- end
- end
- end
-
- context 'sign-in' do
- before do
- oauth_user.save
- oauth_user.gl_user.activate
- end
-
- context 'dont block on create' do
- before { Gitlab.config.omniauth.stub block_auto_created_users: false }
-
- it do
- oauth_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
-
- context 'block on create' do
- before { Gitlab.config.omniauth.stub block_auto_created_users: true }
-
- it do
- oauth_user.save
- expect(gl_user).to be_valid
- expect(gl_user).not_to be_blocked
- end
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb
deleted file mode 100644
index cd9d0456b25c29b51ad8ceceed11dc67d00af87c..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/popen_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::Popen', no_db: true do
- let (:path) { Rails.root.join('tmp').to_s }
-
- before do
- @klass = Class.new(Object)
- @klass.send(:include, Gitlab::Popen)
- end
-
- context 'zero status' do
- before do
- @output, @status = @klass.new.popen(%W(ls), path)
- end
-
- it { expect(@status).to be_zero }
- it { expect(@output).to include('cache') }
- end
-
- context 'non-zero status' do
- before do
- @output, @status = @klass.new.popen(%W(cat NOTHING), path)
- end
-
- it { expect(@status).to eq(1) }
- it { expect(@output).to include('No such file or directory') }
- end
-
- context 'unsafe string command' do
- it 'raises an error when it gets called with a string argument' do
- expect { @klass.new.popen('ls', path) }.to raise_error
- end
- end
-
- context 'without a directory argument' do
- before do
- @output, @status = @klass.new.popen(%W(ls))
- end
-
- it { expect(@status).to be_zero }
- it { expect(@output).to include('spec') }
- end
-
-end
-
diff --git a/spec/lib/gitlab/push_data_builder_spec.rb b/spec/lib/gitlab/push_data_builder_spec.rb
deleted file mode 100644
index 1b8ba7b4d4333d300f62845d8bfccaf1060ced1a..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/push_data_builder_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::PushDataBuilder' do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
-
- describe :build_sample do
- let(:data) { Gitlab::PushDataBuilder.build_sample(project, user) }
-
- it { expect(data).to be_a(Hash) }
- it { expect(data[:before]).to eq('6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') }
- it { expect(data[:after]).to eq('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
- it { expect(data[:ref]).to eq('refs/heads/master') }
- it { expect(data[:commits].size).to eq(3) }
- it { expect(data[:repository][:git_http_url]).to eq(project.http_url_to_repo) }
- it { expect(data[:repository][:git_ssh_url]).to eq(project.ssh_url_to_repo) }
- it { expect(data[:repository][:visibility_level]).to eq(project.visibility_level) }
- it { expect(data[:total_commits_count]).to eq(3) }
- end
-
- describe :build do
- let(:data) do
- Gitlab::PushDataBuilder.build(project,
- user,
- Gitlab::Git::BLANK_SHA,
- '8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b',
- 'refs/tags/v1.1.0')
- end
-
- it { expect(data).to be_a(Hash) }
- it { expect(data[:before]).to eq(Gitlab::Git::BLANK_SHA) }
- it { expect(data[:checkout_sha]).to eq('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
- it { expect(data[:after]).to eq('8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b') }
- it { expect(data[:ref]).to eq('refs/tags/v1.1.0') }
- it { expect(data[:commits]).to be_empty }
- it { expect(data[:total_commits_count]).to be_zero }
- end
-end
diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb
deleted file mode 100644
index c9fb62b61ae7a8218efc464484e362baf4685e60..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/reference_extractor_spec.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::ReferenceExtractor do
- let(:project) { create(:project) }
- subject { Gitlab::ReferenceExtractor.new(project, project.creator) }
-
- it 'extracts username references' do
- subject.analyze('this contains a @user reference')
- expect(subject.references[:user]).to eq([[project, 'user']])
- end
-
- it 'extracts issue references' do
- subject.analyze('this one talks about issue #1234')
- expect(subject.references[:issue]).to eq([[project, '1234']])
- end
-
- it 'extracts JIRA issue references' do
- subject.analyze('this one talks about issue JIRA-1234')
- expect(subject.references[:issue]).to eq([[project, 'JIRA-1234']])
- end
-
- it 'extracts merge request references' do
- subject.analyze("and here's !43, a merge request")
- expect(subject.references[:merge_request]).to eq([[project, '43']])
- end
-
- it 'extracts snippet ids' do
- subject.analyze('snippets like $12 get extracted as well')
- expect(subject.references[:snippet]).to eq([[project, '12']])
- end
-
- it 'extracts commit shas' do
- subject.analyze('commit shas 98cf0ae3 are pulled out as Strings')
- expect(subject.references[:commit]).to eq([[project, '98cf0ae3']])
- end
-
- it 'extracts commit ranges' do
- subject.analyze('here you go, a commit range: 98cf0ae3...98cf0ae4')
- expect(subject.references[:commit_range]).to eq([[project, '98cf0ae3...98cf0ae4']])
- end
-
- it 'extracts multiple references and preserves their order' do
- subject.analyze('@me and @you both care about this')
- expect(subject.references[:user]).to eq([
- [project, 'me'],
- [project, 'you']
- ])
- end
-
- it 'leaves the original note unmodified' do
- text = 'issue #123 is just the worst, @user'
- subject.analyze(text)
- expect(text).to eq('issue #123 is just the worst, @user')
- end
-
- it 'extracts no references for ..
blocks' do
- subject.analyze("def puts '#1 issue'\nend\n
```")
- expect(subject.issues).to be_blank
- end
-
- it 'extracts no references for .. blocks' do
- subject.analyze("def puts '!1 request'\nend\n```")
- expect(subject.merge_requests).to be_blank
- end
-
- it 'extracts no references for code blocks with language' do
- subject.analyze("this code:\n```ruby\ndef puts '#1 issue'\nend\n```")
- expect(subject.issues).to be_blank
- end
-
- it 'extracts issue references for invalid code blocks' do
- subject.analyze('test: ```this one talks about issue #1234```')
- expect(subject.references[:issue]).to eq([[project, '1234']])
- end
-
- it 'handles all possible kinds of references' do
- accessors = Gitlab::Markdown::TYPES.map { |t| "#{t}s".to_sym }
- expect(subject).to respond_to(*accessors)
- end
-
- it 'accesses valid user objects' do
- @u_foo = create(:user, username: 'foo')
- @u_bar = create(:user, username: 'bar')
- @u_offteam = create(:user, username: 'offteam')
-
- project.team << [@u_foo, :reporter]
- project.team << [@u_bar, :guest]
-
- subject.analyze('@foo, @baduser, @bar, and @offteam')
- expect(subject.users).to eq([@u_foo, @u_bar, @u_offteam])
- end
-
- it 'accesses valid issue objects' do
- @i0 = create(:issue, project: project)
- @i1 = create(:issue, project: project)
-
- subject.analyze("##{@i0.iid}, ##{@i1.iid}, and #999.")
- expect(subject.issues).to eq([@i0, @i1])
- end
-
- it 'accesses valid merge requests' do
- @m0 = create(:merge_request, source_project: project, target_project: project, source_branch: 'aaa')
- @m1 = create(:merge_request, source_project: project, target_project: project, source_branch: 'bbb')
-
- subject.analyze("!999, !#{@m1.iid}, and !#{@m0.iid}.")
- expect(subject.merge_requests).to eq([@m1, @m0])
- end
-
- it 'accesses valid snippets' do
- @s0 = create(:project_snippet, project: project)
- @s1 = create(:project_snippet, project: project)
- @s2 = create(:project_snippet)
-
- subject.analyze("$#{@s0.id}, $999, $#{@s2.id}, $#{@s1.id}")
- expect(subject.snippets).to eq([@s0, @s1])
- end
-
- it 'accesses valid commits' do
- commit = project.repository.commit('master')
-
- subject.analyze("this references commits #{commit.sha[0..6]} and 012345")
- extracted = subject.commits
- expect(extracted.size).to eq(1)
- expect(extracted[0].sha).to eq(commit.sha)
- expect(extracted[0].message).to eq(commit.message)
- end
-
- it 'accesses valid commit ranges' do
- commit = project.repository.commit('master')
- earlier_commit = project.repository.commit('master~2')
-
- subject.analyze("this references commits #{earlier_commit.sha[0..6]}...#{commit.sha[0..6]}")
- extracted = subject.commit_ranges
- expect(extracted.size).to eq(1)
- expect(extracted[0][0].sha).to eq(earlier_commit.sha)
- expect(extracted[0][0].message).to eq(earlier_commit.message)
- expect(extracted[0][1].sha).to eq(commit.sha)
- expect(extracted[0][1].message).to eq(commit.message)
- end
-
- context 'with a project with an underscore' do
- let(:other_project) { create(:project, path: 'test_project') }
- let(:issue) { create(:issue, project: other_project) }
-
- before do
- other_project.team << [project.creator, :developer]
- end
-
- it 'handles project issue references' do
- subject.analyze("this refers issue #{other_project.path_with_namespace}##{issue.iid}")
- extracted = subject.issues
- expect(extracted.size).to eq(1)
- expect(extracted).to eq([issue])
- end
- end
-end
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
deleted file mode 100644
index 727884c41c5565dc215e322b147fe6cc38932cb5..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/regex_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Regex do
- describe 'project path regex' do
- it { expect('gitlab-ce').to match(Gitlab::Regex.project_path_regex) }
- it { expect('gitlab_git').to match(Gitlab::Regex.project_path_regex) }
- it { expect('_underscore.js').to match(Gitlab::Regex.project_path_regex) }
- it { expect('100px.com').to match(Gitlab::Regex.project_path_regex) }
- it { expect('?gitlab').not_to match(Gitlab::Regex.project_path_regex) }
- it { expect('git lab').not_to match(Gitlab::Regex.project_path_regex) }
- it { expect('gitlab.git').not_to match(Gitlab::Regex.project_path_regex) }
- end
-
- describe 'project name regex' do
- it { expect('gitlab-ce').to match(Gitlab::Regex.project_name_regex) }
- it { expect('GitLab CE').to match(Gitlab::Regex.project_name_regex) }
- it { expect('100 lines').to match(Gitlab::Regex.project_name_regex) }
- it { expect('gitlab.git').to match(Gitlab::Regex.project_name_regex) }
- it { expect('?gitlab').not_to match(Gitlab::Regex.project_name_regex) }
- end
-end
diff --git a/spec/lib/gitlab/satellite/action_spec.rb b/spec/lib/gitlab/satellite/action_spec.rb
deleted file mode 100644
index 28e3d64ee2be0528484216f6dac785cd74de7339..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/satellite/action_spec.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::Satellite::Action' do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- describe '#prepare_satellite!' do
- it 'should be able to fetch timeout from conf' do
- expect(Gitlab::Satellite::Action::DEFAULT_OPTIONS[:git_timeout]).to eq(30.seconds)
- end
-
- it 'create a repository with a parking branch and one remote: origin' do
- repo = project.satellite.repo
-
- #now lets dirty it up
-
- starting_remote_count = repo.git.list_remotes.size
- expect(starting_remote_count).to be >= 1
- #kind of hookey way to add a second remote
- origin_uri = repo.git.remote({v: true}).split(" ")[1]
- begin
- repo.git.remote({raise: true}, 'add', 'another-remote', origin_uri)
- repo.git.branch({raise: true}, 'a-new-branch')
-
- expect(repo.heads.size).to be > (starting_remote_count)
- expect(repo.git.remote().split(" ").size).to be > (starting_remote_count)
- rescue
- end
-
- repo.git.config({}, "user.name", "#{user.name} -- foo")
- repo.git.config({}, "user.email", "#{user.email} -- foo")
- expect(repo.config['user.name']).to eq("#{user.name} -- foo")
- expect(repo.config['user.email']).to eq("#{user.email} -- foo")
-
-
- #These must happen in the context of the satellite directory...
- satellite_action = Gitlab::Satellite::Action.new(user, project)
- project.satellite.lock {
- #Now clean it up, use send to get around prepare_satellite! being protected
- satellite_action.send(:prepare_satellite!, repo)
- }
-
- #verify it's clean
- heads = repo.heads.map(&:name)
- expect(heads.size).to eq(1)
- expect(heads.include?(Gitlab::Satellite::Satellite::PARKING_BRANCH)).to eq(true)
- remotes = repo.git.remote().split(' ')
- expect(remotes.size).to eq(1)
- expect(remotes.include?('origin')).to eq(true)
- expect(repo.config['user.name']).to eq(user.name)
- expect(repo.config['user.email']).to eq(user.email)
- end
- end
-
- describe '#in_locked_and_timed_satellite' do
-
- it 'should make use of a lockfile' do
- repo = project.satellite.repo
- called = false
-
- #set assumptions
- FileUtils.rm_f(project.satellite.lock_file)
-
- expect(File.exists?(project.satellite.lock_file)).to be_falsey
-
- satellite_action = Gitlab::Satellite::Action.new(user, project)
- satellite_action.send(:in_locked_and_timed_satellite) do |sat_repo|
- expect(repo).to eq(sat_repo)
- expect(File.exists? project.satellite.lock_file).to be_truthy
- called = true
- end
-
- expect(called).to be_truthy
-
- end
-
- it 'should be able to use the satellite after locking' do
- repo = project.satellite.repo
- called = false
-
- # Set base assumptions
- if File.exists? project.satellite.lock_file
- expect(FileLockStatusChecker.new(project.satellite.lock_file).flocked?).to be_falsey
- end
-
- satellite_action = Gitlab::Satellite::Action.new(user, project)
- satellite_action.send(:in_locked_and_timed_satellite) do |sat_repo|
- called = true
- expect(repo).to eq(sat_repo)
- expect(File.exists? project.satellite.lock_file).to be_truthy
- expect(FileLockStatusChecker.new(project.satellite.lock_file).flocked?).to be_truthy
- end
-
- expect(called).to be_truthy
- expect(FileLockStatusChecker.new(project.satellite.lock_file).flocked?).to be_falsey
-
- end
-
- class FileLockStatusChecker < File
- def flocked?(&block)
- status = flock LOCK_EX|LOCK_NB
- case status
- when false
- return true
- when 0
- begin
- block ? block.call : false
- ensure
- flock LOCK_UN
- end
- else
- raise SystemCallError, status
- end
- end
- end
-
- end
-end
diff --git a/spec/lib/gitlab/satellite/merge_action_spec.rb b/spec/lib/gitlab/satellite/merge_action_spec.rb
deleted file mode 100644
index 915e3ff0e5167219787780ca4b7f994fb1e2cb59..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/satellite/merge_action_spec.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::Satellite::MergeAction' do
- include RepoHelpers
-
- let(:project) { create(:project, namespace: create(:group)) }
- let(:fork_project) { create(:project, namespace: create(:group), forked_from_project: project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:merge_request_fork) { create(:merge_request, source_project: fork_project, target_project: project) }
-
- let(:merge_request_with_conflict) { create(:merge_request, :conflict, source_project: project, target_project: project) }
- let(:merge_request_fork_with_conflict) { create(:merge_request, :conflict, source_project: project, target_project: project) }
-
- describe '#commits_between' do
- def verify_commits(commits, first_commit_sha, last_commit_sha)
- commits.each { |commit| expect(commit.class).to eq(Gitlab::Git::Commit) }
- expect(commits.first.id).to eq(first_commit_sha)
- expect(commits.last.id).to eq(last_commit_sha)
- end
-
- context 'on fork' do
- it 'should get proper commits between' do
- commits = Gitlab::Satellite::MergeAction.new(merge_request_fork.author, merge_request_fork).commits_between
- verify_commits(commits, sample_compare.commits.first, sample_compare.commits.last)
- end
- end
-
- context 'between branches' do
- it 'should raise exception -- not expected to be used by non forks' do
- expect { Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).commits_between }.to raise_error
- end
- end
- end
-
- describe '#format_patch' do
- def verify_content(patch)
- sample_compare.commits.each do |commit|
- expect(patch.include?(commit)).to be_truthy
- end
- end
-
- context 'on fork' do
- it 'should build a format patch' do
- patch = Gitlab::Satellite::MergeAction.new(merge_request_fork.author, merge_request_fork).format_patch
- verify_content(patch)
- end
- end
-
- context 'between branches' do
- it 'should build a format patch' do
- patch = Gitlab::Satellite::MergeAction.new(merge_request_fork.author, merge_request).format_patch
- verify_content(patch)
- end
- end
- end
-
- describe '#diffs_between_satellite tested against diff_in_satellite' do
- def is_a_matching_diff(diff, diffs)
- diff_count = diff.scan('diff --git').size
- expect(diff_count).to be >= 1
- expect(diffs.size).to eq(diff_count)
- diffs.each do |a_diff|
- expect(a_diff.class).to eq(Gitlab::Git::Diff)
- expect(diff.include? a_diff.diff).to be_truthy
- end
- end
-
- context 'on fork' do
- it 'should get proper diffs' do
- diffs = Gitlab::Satellite::MergeAction.new(merge_request_fork.author, merge_request_fork).diffs_between_satellite
- diff = Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request_fork).diff_in_satellite
- is_a_matching_diff(diff, diffs)
- end
- end
-
- context 'between branches' do
- it 'should get proper diffs' do
- expect{ Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).diffs_between_satellite }.to raise_error
- end
- end
- end
-
- describe '#can_be_merged?' do
- context 'on fork' do
- it { expect(Gitlab::Satellite::MergeAction.new(
- merge_request_fork.author,
- merge_request_fork).can_be_merged?).to be_truthy }
-
- it { expect(Gitlab::Satellite::MergeAction.new(
- merge_request_fork_with_conflict.author,
- merge_request_fork_with_conflict).can_be_merged?).to be_falsey }
- end
-
- context 'between branches' do
- it { expect(Gitlab::Satellite::MergeAction.new(
- merge_request.author,
- merge_request).can_be_merged?).to be_truthy }
-
- it { expect(Gitlab::Satellite::MergeAction.new(
- merge_request_with_conflict.author,
- merge_request_with_conflict).can_be_merged?).to be_falsey }
- end
- end
-end
diff --git a/spec/lib/gitlab/upgrader_spec.rb b/spec/lib/gitlab/upgrader_spec.rb
deleted file mode 100644
index ce3ea6c260aa66659caa758c328cb00f8a3a9fcf..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/upgrader_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Upgrader do
- let(:upgrader) { Gitlab::Upgrader.new }
- let(:current_version) { Gitlab::VERSION }
-
- describe 'current_version_raw' do
- it { expect(upgrader.current_version_raw).to eq(current_version) }
- end
-
- describe 'latest_version?' do
- it 'should be true if newest version' do
- upgrader.stub(latest_version_raw: current_version)
- expect(upgrader.latest_version?).to be_truthy
- end
- end
-
- describe 'latest_version_raw' do
- it 'should be latest version for GitLab 5' do
- upgrader.stub(current_version_raw: "5.3.0")
- expect(upgrader.latest_version_raw).to eq("v5.4.2")
- end
- end
-end
diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb
deleted file mode 100644
index 5153ed15af3f865fed83d30545d9d99a82685639..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/url_builder_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::UrlBuilder do
- describe 'When asking for an issue' do
- it 'returns the issue url' do
- issue = create(:issue)
- url = Gitlab::UrlBuilder.new(:issue).build(issue.id)
- expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.path_with_namespace}/issues/#{issue.iid}"
- end
- end
-
- describe 'When asking for an merge request' do
- it 'returns the merge request url' do
- merge_request = create(:merge_request)
- url = Gitlab::UrlBuilder.new(:merge_request).build(merge_request.id)
- expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.path_with_namespace}/merge_requests/#{merge_request.iid}"
- end
- end
-
- describe 'When asking for a note on commit' do
- let(:note) { create(:note_on_commit) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{note.project.path_with_namespace}/commit/#{note.commit_id}#note_#{note.id}"
- end
- end
-
- describe 'When asking for a note on commit diff' do
- let(:note) { create(:note_on_commit_diff) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{note.project.path_with_namespace}/commit/#{note.commit_id}#note_#{note.id}"
- end
- end
-
- describe 'When asking for a note on issue' do
- let(:issue) { create(:issue) }
- let(:note) { create(:note_on_issue, noteable_id: issue.id) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.path_with_namespace}/issues/#{issue.iid}#note_#{note.id}"
- end
- end
-
- describe 'When asking for a note on merge request' do
- let(:merge_request) { create(:merge_request) }
- let(:note) { create(:note_on_merge_request, noteable_id: merge_request.id) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.path_with_namespace}/merge_requests/#{merge_request.iid}#note_#{note.id}"
- end
- end
-
- describe 'When asking for a note on merge request diff' do
- let(:merge_request) { create(:merge_request) }
- let(:note) { create(:note_on_merge_request_diff, noteable_id: merge_request.id) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.path_with_namespace}/merge_requests/#{merge_request.iid}#note_#{note.id}"
- end
- end
-
- describe 'When asking for a note on project snippet' do
- let(:snippet) { create(:project_snippet) }
- let(:note) { create(:note_on_project_snippet, noteable_id: snippet.id) }
- let(:url) { Gitlab::UrlBuilder.new(:note).build(note.id) }
-
- it 'returns the note url' do
- expect(url).to eq "#{Settings.gitlab['url']}/#{snippet.project.path_with_namespace}/snippets/#{note.noteable_id}#note_#{note.id}"
- end
- end
-end
diff --git a/spec/lib/gitlab/version_info_spec.rb b/spec/lib/gitlab/version_info_spec.rb
deleted file mode 100644
index 5afeb1c1ec3048de7691da7e2f8f0991200b7187..0000000000000000000000000000000000000000
--- a/spec/lib/gitlab/version_info_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'spec_helper'
-
-describe 'Gitlab::VersionInfo', no_db: true do
- before do
- @unknown = Gitlab::VersionInfo.new
- @v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1)
- @v0_1_0 = Gitlab::VersionInfo.new(0, 1, 0)
- @v1_0_0 = Gitlab::VersionInfo.new(1, 0, 0)
- @v1_0_1 = Gitlab::VersionInfo.new(1, 0, 1)
- @v1_1_0 = Gitlab::VersionInfo.new(1, 1, 0)
- @v2_0_0 = Gitlab::VersionInfo.new(2, 0, 0)
- end
-
- context '>' do
- it { expect(@v2_0_0).to be > @v1_1_0 }
- it { expect(@v1_1_0).to be > @v1_0_1 }
- it { expect(@v1_0_1).to be > @v1_0_0 }
- it { expect(@v1_0_0).to be > @v0_1_0 }
- it { expect(@v0_1_0).to be > @v0_0_1 }
- end
-
- context '>=' do
- it { expect(@v2_0_0).to be >= Gitlab::VersionInfo.new(2, 0, 0) }
- it { expect(@v2_0_0).to be >= @v1_1_0 }
- end
-
- context '<' do
- it { expect(@v0_0_1).to be < @v0_1_0 }
- it { expect(@v0_1_0).to be < @v1_0_0 }
- it { expect(@v1_0_0).to be < @v1_0_1 }
- it { expect(@v1_0_1).to be < @v1_1_0 }
- it { expect(@v1_1_0).to be < @v2_0_0 }
- end
-
- context '<=' do
- it { expect(@v0_0_1).to be <= Gitlab::VersionInfo.new(0, 0, 1) }
- it { expect(@v0_0_1).to be <= @v0_1_0 }
- end
-
- context '==' do
- it { expect(@v0_0_1).to eq(Gitlab::VersionInfo.new(0, 0, 1)) }
- it { expect(@v0_1_0).to eq(Gitlab::VersionInfo.new(0, 1, 0)) }
- it { expect(@v1_0_0).to eq(Gitlab::VersionInfo.new(1, 0, 0)) }
- end
-
- context '!=' do
- it { expect(@v0_0_1).not_to eq(@v0_1_0) }
- end
-
- context 'unknown' do
- it { expect(@unknown).not_to be @v0_0_1 }
- it { expect(@unknown).not_to be Gitlab::VersionInfo.new }
- it { expect{@unknown > @v0_0_1}.to raise_error(ArgumentError) }
- it { expect{@unknown < @v0_0_1}.to raise_error(ArgumentError) }
- end
-
- context 'parse' do
- it { expect(Gitlab::VersionInfo.parse("1.0.0")).to eq(@v1_0_0) }
- it { expect(Gitlab::VersionInfo.parse("1.0.0.1")).to eq(@v1_0_0) }
- it { expect(Gitlab::VersionInfo.parse("git 1.0.0b1")).to eq(@v1_0_0) }
- it { expect(Gitlab::VersionInfo.parse("git 1.0b1")).not_to be_valid }
- end
-
- context 'to_s' do
- it { expect(@v1_0_0.to_s).to eq("1.0.0") }
- it { expect(@unknown.to_s).to eq("Unknown") }
- end
-end
-
diff --git a/spec/lib/repository_cache_spec.rb b/spec/lib/repository_cache_spec.rb
deleted file mode 100644
index af399f3a7319795710c5052736f1413f2c36baa7..0000000000000000000000000000000000000000
--- a/spec/lib/repository_cache_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'rspec'
-require_relative '../../lib/repository_cache'
-
-describe RepositoryCache do
- let(:backend) { double('backend').as_null_object }
- let(:cache) { RepositoryCache.new('example', backend) }
-
- describe '#cache_key' do
- it 'includes the namespace' do
- expect(cache.cache_key(:foo)).to eq 'foo:example'
- end
- end
-
- describe '#expire' do
- it 'expires the given key from the cache' do
- cache.expire(:foo)
- expect(backend).to have_received(:delete).with('foo:example')
- end
- end
-
- describe '#fetch' do
- it 'fetches the given key from the cache' do
- cache.fetch(:bar)
- expect(backend).to have_received(:fetch).with('bar:example')
- end
-
- it 'accepts a block' do
- p = -> {}
-
- cache.fetch(:baz, &p)
- expect(backend).to have_received(:fetch).with('baz:example', &p)
- end
- end
-end
diff --git a/spec/lib/votes_spec.rb b/spec/lib/votes_spec.rb
deleted file mode 100644
index df243a26008dca1ab7fafe6907b95d21fc49717a..0000000000000000000000000000000000000000
--- a/spec/lib/votes_spec.rb
+++ /dev/null
@@ -1,185 +0,0 @@
-require 'spec_helper'
-
-describe Issue, 'Votes' do
- let(:issue) { create(:issue) }
-
- describe "#upvotes" do
- it "with no notes has a 0/0 score" do
- expect(issue.upvotes).to eq(0)
- end
-
- it "should recognize non-+1 notes" do
- add_note "No +1 here"
- expect(issue.notes.size).to eq(1)
- expect(issue.notes.first.upvote?).to be_falsey
- expect(issue.upvotes).to eq(0)
- end
-
- it "should recognize a single +1 note" do
- add_note "+1 This is awesome"
- expect(issue.upvotes).to eq(1)
- end
-
- it 'should recognize multiple +1 notes' do
- add_note '+1 This is awesome', create(:user)
- add_note '+1 I want this', create(:user)
- expect(issue.upvotes).to eq(2)
- end
-
- it 'should not count 2 +1 votes from the same user' do
- add_note '+1 This is awesome'
- add_note '+1 I want this'
- expect(issue.upvotes).to eq(1)
- end
- end
-
- describe "#downvotes" do
- it "with no notes has a 0/0 score" do
- expect(issue.downvotes).to eq(0)
- end
-
- it "should recognize non--1 notes" do
- add_note "Almost got a -1"
- expect(issue.notes.size).to eq(1)
- expect(issue.notes.first.downvote?).to be_falsey
- expect(issue.downvotes).to eq(0)
- end
-
- it "should recognize a single -1 note" do
- add_note "-1 This is bad"
- expect(issue.downvotes).to eq(1)
- end
-
- it "should recognize multiple -1 notes" do
- add_note('-1 This is bad', create(:user))
- add_note('-1 Away with this', create(:user))
- expect(issue.downvotes).to eq(2)
- end
- end
-
- describe "#votes_count" do
- it "with no notes has a 0/0 score" do
- expect(issue.votes_count).to eq(0)
- end
-
- it "should recognize non notes" do
- add_note "No +1 here"
- expect(issue.notes.size).to eq(1)
- expect(issue.votes_count).to eq(0)
- end
-
- it "should recognize a single +1 note" do
- add_note "+1 This is awesome"
- expect(issue.votes_count).to eq(1)
- end
-
- it "should recognize a single -1 note" do
- add_note "-1 This is bad"
- expect(issue.votes_count).to eq(1)
- end
-
- it "should recognize multiple notes" do
- add_note('+1 This is awesome', create(:user))
- add_note('-1 This is bad', create(:user))
- add_note('+1 I want this', create(:user))
- expect(issue.votes_count).to eq(3)
- end
-
- it 'should not count 2 -1 votes from the same user' do
- add_note '-1 This is suspicious'
- add_note '-1 This is bad'
- expect(issue.votes_count).to eq(1)
- end
- end
-
- describe "#upvotes_in_percent" do
- it "with no notes has a 0% score" do
- expect(issue.upvotes_in_percent).to eq(0)
- end
-
- it "should count a single 1 note as 100%" do
- add_note "+1 This is awesome"
- expect(issue.upvotes_in_percent).to eq(100)
- end
-
- it 'should count multiple +1 notes as 100%' do
- add_note('+1 This is awesome', create(:user))
- add_note('+1 I want this', create(:user))
- expect(issue.upvotes_in_percent).to eq(100)
- end
-
- it 'should count fractions for multiple +1 and -1 notes correctly' do
- add_note('+1 This is awesome', create(:user))
- add_note('+1 I want this', create(:user))
- add_note('-1 This is bad', create(:user))
- add_note('+1 me too', create(:user))
- expect(issue.upvotes_in_percent).to eq(75)
- end
- end
-
- describe "#downvotes_in_percent" do
- it "with no notes has a 0% score" do
- expect(issue.downvotes_in_percent).to eq(0)
- end
-
- it "should count a single -1 note as 100%" do
- add_note "-1 This is bad"
- expect(issue.downvotes_in_percent).to eq(100)
- end
-
- it 'should count multiple -1 notes as 100%' do
- add_note('-1 This is bad', create(:user))
- add_note('-1 Away with this', create(:user))
- expect(issue.downvotes_in_percent).to eq(100)
- end
-
- it 'should count fractions for multiple +1 and -1 notes correctly' do
- add_note('+1 This is awesome', create(:user))
- add_note('+1 I want this', create(:user))
- add_note('-1 This is bad', create(:user))
- add_note('+1 me too', create(:user))
- expect(issue.downvotes_in_percent).to eq(25)
- end
- end
-
- describe '#filter_superceded_votes' do
-
- it 'should count a users vote only once amongst multiple votes' do
- add_note('-1 This needs work before I will accept it')
- add_note('+1 I want this', create(:user))
- add_note('+1 This is is awesome', create(:user))
- add_note('+1 this looks good now')
- add_note('+1 This is awesome', create(:user))
- add_note('+1 me too', create(:user))
- expect(issue.downvotes).to eq(0)
- expect(issue.upvotes).to eq(5)
- end
-
- it 'should count each users vote only once' do
- add_note '-1 This needs work before it will be accepted'
- add_note '+1 I like this'
- add_note '+1 I still like this'
- add_note '+1 I really like this'
- add_note '+1 Give me this now!!!!'
- expect(issue.downvotes).to eq(0)
- expect(issue.upvotes).to eq(1)
- end
-
- it 'should count a users vote only once without caring about comments' do
- add_note '-1 This needs work before it will be accepted'
- add_note 'Comment 1'
- add_note 'Another comment'
- add_note '+1 vote'
- add_note 'final comment'
- expect(issue.downvotes).to eq(0)
- expect(issue.upvotes).to eq(1)
- end
-
- end
-
- def add_note(text, author = issue.author)
- created_at = Time.now - 1.hour + Note.count.seconds
- issue.notes << create(:note, note: text, project: issue.project,
- author_id: author.id, created_at: created_at)
- end
-end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
deleted file mode 100644
index b297fbd51192f49354ef8f0dc391be9461c6e2c1..0000000000000000000000000000000000000000
--- a/spec/mailers/notify_spec.rb
+++ /dev/null
@@ -1,808 +0,0 @@
-require 'spec_helper'
-
-describe Notify do
- include EmailSpec::Helpers
- include EmailSpec::Matchers
- include RepoHelpers
-
- let(:gitlab_sender_display_name) { Gitlab.config.gitlab.email_display_name }
- let(:gitlab_sender) { Gitlab.config.gitlab.email_from }
- let(:gitlab_sender_reply_to) { Gitlab.config.gitlab.email_reply_to }
- let(:recipient) { create(:user, email: 'recipient@example.com') }
- let(:project) { create(:project) }
-
- around(:each) { ActionMailer::Base.deliveries.clear }
-
- before(:each) do
- email = recipient.emails.create(email: "notifications@example.com")
- recipient.update_attribute(:notification_email, email.email)
- end
-
- shared_examples 'a multiple recipients email' do
- it 'is sent to the given recipient' do
- is_expected.to deliver_to recipient.notification_email
- end
- end
-
- shared_examples 'an email sent from GitLab' do
- it 'is sent from GitLab' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(gitlab_sender_display_name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has a Reply-To address' do
- reply_to = subject.header[:reply_to].addresses
- expect(reply_to).to eq([gitlab_sender_reply_to])
- end
- end
-
- shared_examples 'an email starting a new thread' do |message_id_prefix|
- it 'has a discussion identifier' do
- is_expected.to have_header 'Message-ID', /<#{message_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/
- is_expected.to have_header 'X-GitLab-Project', /#{project.name}/
- end
- end
-
- shared_examples 'an answer to an existing thread' do |thread_id_prefix|
- it 'has a subject that begins with Re: ' do
- is_expected.to have_subject /^Re: /
- end
-
- it 'has headers that reference an existing thread' do
- is_expected.to have_header 'References', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/
- is_expected.to have_header 'In-Reply-To', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/
- is_expected.to have_header 'X-GitLab-Project', /#{project.name}/
- end
- end
-
- describe 'for new users, the email' do
- let(:example_site_path) { root_path }
- let(:new_user) { create(:user, email: 'newguy@example.com', created_by_id: 1) }
-
- token = 'kETLwRaayvigPq_x3SNM'
-
- subject { Notify.new_user_email(new_user.id, token) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'is sent to the new user' do
- is_expected.to deliver_to new_user.email
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /^Account was created for you$/i
- end
-
- it 'contains the new user\'s login name' do
- is_expected.to have_body_text /#{new_user.email}/
- end
-
- it 'contains the password text' do
- is_expected.to have_body_text /Click here to set your password/
- end
-
- it 'includes a link for user to set password' do
- params = "reset_password_token=#{token}"
- is_expected.to have_body_text(
- %r{http://localhost(:\d+)?/users/password/edit\?#{params}}
- )
- end
-
- it 'includes a link to the site' do
- is_expected.to have_body_text /#{example_site_path}/
- end
- end
-
-
- describe 'for users that signed up, the email' do
- let(:example_site_path) { root_path }
- let(:new_user) { create(:user, email: 'newguy@example.com', password: "securePassword") }
-
- subject { Notify.new_user_email(new_user.id) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'is sent to the new user' do
- is_expected.to deliver_to new_user.email
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /^Account was created for you$/i
- end
-
- it 'contains the new user\'s login name' do
- is_expected.to have_body_text /#{new_user.email}/
- end
-
- it 'should not contain the new user\'s password' do
- is_expected.not_to have_body_text /password/
- end
-
- it 'includes a link to the site' do
- is_expected.to have_body_text /#{example_site_path}/
- end
- end
-
- describe 'user added ssh key' do
- let(:key) { create(:personal_key) }
-
- subject { Notify.new_ssh_key_email(key.id) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'is sent to the new user' do
- is_expected.to deliver_to key.user.email
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /^SSH key was added to your account$/i
- end
-
- it 'contains the new ssh key title' do
- is_expected.to have_body_text /#{key.title}/
- end
-
- it 'includes a link to ssh keys page' do
- is_expected.to have_body_text /#{profile_keys_path}/
- end
- end
-
- describe 'user added email' do
- let(:email) { create(:email) }
-
- subject { Notify.new_email_email(email.id) }
-
- it 'is sent to the new user' do
- is_expected.to deliver_to email.user.email
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /^Email was added to your account$/i
- end
-
- it 'contains the new email address' do
- is_expected.to have_body_text /#{email.email}/
- end
-
- it 'includes a link to emails page' do
- is_expected.to have_body_text /#{profile_emails_path}/
- end
- end
-
- context 'for a project' do
- describe 'items that are assignable, the email' do
- let(:current_user) { create(:user, email: "current@email.com") }
- let(:assignee) { create(:user, email: 'assignee@example.com') }
- let(:previous_assignee) { create(:user, name: 'Previous Assignee') }
-
- shared_examples 'an assignee email' do
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(current_user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to the assignee' do
- is_expected.to deliver_to assignee.email
- end
- end
-
- context 'for issues' do
- let(:issue) { create(:issue, author: current_user, assignee: assignee, project: project) }
- let(:issue_with_description) { create(:issue, author: current_user, assignee: assignee, project: project, description: Faker::Lorem.sentence) }
-
- describe 'that are new' do
- subject { Notify.new_issue_email(issue.assignee_id, issue.id) }
-
- it_behaves_like 'an assignee email'
- it_behaves_like 'an email starting a new thread', 'issue'
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{project.name} \| #{issue.title} \(##{issue.iid}\)/
- end
-
- it 'contains a link to the new issue' do
- is_expected.to have_body_text /#{namespace_project_issue_path project.namespace, project, issue}/
- end
- end
-
- describe 'that are new with a description' do
- subject { Notify.new_issue_email(issue_with_description.assignee_id, issue_with_description.id) }
-
- it 'contains the description' do
- is_expected.to have_body_text /#{issue_with_description.description}/
- end
- end
-
- describe 'that have been reassigned' do
- subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) }
-
- it_behaves_like 'a multiple recipients email'
- it_behaves_like 'an answer to an existing thread', 'issue'
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(current_user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{issue.title} \(##{issue.iid}\)/
- end
-
- it 'contains the name of the previous assignee' do
- is_expected.to have_body_text /#{previous_assignee.name}/
- end
-
- it 'contains the name of the new assignee' do
- is_expected.to have_body_text /#{assignee.name}/
- end
-
- it 'contains a link to the issue' do
- is_expected.to have_body_text /#{namespace_project_issue_path project.namespace, project, issue}/
- end
- end
-
- describe 'status changed' do
- let(:status) { 'closed' }
- subject { Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user) }
-
- it_behaves_like 'an answer to an existing thread', 'issue'
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(current_user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{issue.title} \(##{issue.iid}\)/i
- end
-
- it 'contains the new status' do
- is_expected.to have_body_text /#{status}/i
- end
-
- it 'contains the user name' do
- is_expected.to have_body_text /#{current_user.name}/i
- end
-
- it 'contains a link to the issue' do
- is_expected.to have_body_text /#{namespace_project_issue_path project.namespace, project, issue}/
- end
- end
-
- end
-
- context 'for merge requests' do
- let(:merge_author) { create(:user) }
- let(:merge_request) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project) }
- let(:merge_request_with_description) { create(:merge_request, author: current_user, assignee: assignee, source_project: project, target_project: project, description: Faker::Lorem.sentence) }
-
- describe 'that are new' do
- subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) }
-
- it_behaves_like 'an assignee email'
- it_behaves_like 'an email starting a new thread', 'merge_request'
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{merge_request.title} \(##{merge_request.iid}\)/
- end
-
- it 'contains a link to the new merge request' do
- is_expected.to have_body_text /#{namespace_project_merge_request_path(project.namespace, project, merge_request)}/
- end
-
- it 'contains the source branch for the merge request' do
- is_expected.to have_body_text /#{merge_request.source_branch}/
- end
-
- it 'contains the target branch for the merge request' do
- is_expected.to have_body_text /#{merge_request.target_branch}/
- end
-
- it 'has the correct message-id set' do
- is_expected.to have_header 'Message-ID', ""
- end
- end
-
- describe 'that are new with a description' do
- subject { Notify.new_merge_request_email(merge_request_with_description.assignee_id, merge_request_with_description.id) }
-
- it 'contains the description' do
- is_expected.to have_body_text /#{merge_request_with_description.description}/
- end
- end
-
- describe 'that are reassigned' do
- subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.id) }
-
- it_behaves_like 'a multiple recipients email'
- it_behaves_like 'an answer to an existing thread', 'merge_request'
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(current_user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{merge_request.title} \(##{merge_request.iid}\)/
- end
-
- it 'contains the name of the previous assignee' do
- is_expected.to have_body_text /#{previous_assignee.name}/
- end
-
- it 'contains the name of the new assignee' do
- is_expected.to have_body_text /#{assignee.name}/
- end
-
- it 'contains a link to the merge request' do
- is_expected.to have_body_text /#{namespace_project_merge_request_path project.namespace, project, merge_request}/
- end
- end
-
- describe 'status changed' do
- let(:status) { 'reopened' }
- subject { Notify.merge_request_status_email(recipient.id, merge_request.id, status, current_user) }
-
- it_behaves_like 'an answer to an existing thread', 'merge_request'
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(current_user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{merge_request.title} \(##{merge_request.iid}\)/i
- end
-
- it 'contains the new status' do
- is_expected.to have_body_text /#{status}/i
- end
-
- it 'contains the user name' do
- is_expected.to have_body_text /#{current_user.name}/i
- end
-
- it 'contains a link to the merge request' do
- is_expected.to have_body_text /#{namespace_project_merge_request_path project.namespace, project, merge_request}/
- end
- end
-
- describe 'that are merged' do
- subject { Notify.merged_merge_request_email(recipient.id, merge_request.id, merge_author.id) }
-
- it_behaves_like 'a multiple recipients email'
- it_behaves_like 'an answer to an existing thread', 'merge_request'
-
- it 'is sent as the merge author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(merge_author.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{merge_request.title} \(##{merge_request.iid}\)/
- end
-
- it 'contains the new status' do
- is_expected.to have_body_text /merged/i
- end
-
- it 'contains a link to the merge request' do
- is_expected.to have_body_text /#{namespace_project_merge_request_path project.namespace, project, merge_request}/
- end
- end
- end
- end
-
- describe 'project was moved' do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- subject { Notify.project_was_moved_email(project.id, user.id) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'has the correct subject' do
- is_expected.to have_subject /Project was moved/
- end
-
- it 'contains name of project' do
- is_expected.to have_body_text /#{project.name_with_namespace}/
- end
-
- it 'contains new user role' do
- is_expected.to have_body_text /#{project.ssh_url_to_repo}/
- end
- end
-
- describe 'project access changed' do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:project_member) { create(:project_member,
- project: project,
- user: user) }
- subject { Notify.project_access_granted_email(project_member.id) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'has the correct subject' do
- is_expected.to have_subject /Access to project was granted/
- end
- it 'contains name of project' do
- is_expected.to have_body_text /#{project.name}/
- end
- it 'contains new user role' do
- is_expected.to have_body_text /#{project_member.human_access}/
- end
- end
-
- context 'items that are noteable, the email for a note' do
- let(:note_author) { create(:user, name: 'author_name') }
- let(:note) { create(:note, project: project, author: note_author) }
-
- before :each do
- allow(Note).to receive(:find).with(note.id).and_return(note)
- end
-
- shared_examples 'a note email' do
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(note_author.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to the given recipient' do
- is_expected.to deliver_to recipient.notification_email
- end
-
- it 'contains the message from the note' do
- is_expected.to have_body_text /#{note.note}/
- end
- end
-
- describe 'on a commit' do
- let(:commit) { project.repository.commit }
-
- before(:each) { allow(note).to receive(:noteable).and_return(commit) }
-
- subject { Notify.note_commit_email(recipient.id, note.id) }
-
- it_behaves_like 'a note email'
- it_behaves_like 'an answer to an existing thread', 'commits'
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{commit.title} \(#{commit.short_id}\)/
- end
-
- it 'contains a link to the commit' do
- is_expected.to have_body_text commit.short_id
- end
- end
-
- describe 'on a merge request' do
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:note_on_merge_request_path) { namespace_project_merge_request_path(project.namespace, project, merge_request, anchor: "note_#{note.id}") }
- before(:each) { allow(note).to receive(:noteable).and_return(merge_request) }
-
- subject { Notify.note_merge_request_email(recipient.id, note.id) }
-
- it_behaves_like 'a note email'
- it_behaves_like 'an answer to an existing thread', 'merge_request'
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{merge_request.title} \(##{merge_request.iid}\)/
- end
-
- it 'contains a link to the merge request note' do
- is_expected.to have_body_text /#{note_on_merge_request_path}/
- end
- end
-
- describe 'on an issue' do
- let(:issue) { create(:issue, project: project) }
- let(:note_on_issue_path) { namespace_project_issue_path(project.namespace, project, issue, anchor: "note_#{note.id}") }
- before(:each) { allow(note).to receive(:noteable).and_return(issue) }
-
- subject { Notify.note_issue_email(recipient.id, note.id) }
-
- it_behaves_like 'a note email'
- it_behaves_like 'an answer to an existing thread', 'issue'
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{issue.title} \(##{issue.iid}\)/
- end
-
- it 'contains a link to the issue note' do
- is_expected.to have_body_text /#{note_on_issue_path}/
- end
- end
- end
- end
-
- describe 'group access changed' do
- let(:group) { create(:group) }
- let(:user) { create(:user) }
- let(:membership) { create(:group_member, group: group, user: user) }
-
- subject { Notify.group_access_granted_email(membership.id) }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'has the correct subject' do
- is_expected.to have_subject /Access to group was granted/
- end
-
- it 'contains name of project' do
- is_expected.to have_body_text /#{group.name}/
- end
-
- it 'contains new user role' do
- is_expected.to have_body_text /#{membership.human_access}/
- end
- end
-
- describe 'confirmation if email changed' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user, email: 'old-email@mail.com') }
-
- before do
- user.email = "new-email@mail.com"
- user.save
- end
-
- subject { ActionMailer::Base.deliveries.last }
-
- it_behaves_like 'an email sent from GitLab'
-
- it 'is sent to the new user' do
- is_expected.to deliver_to 'new-email@mail.com'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject "Confirmation instructions"
- end
-
- it 'includes a link to the site' do
- is_expected.to have_body_text /#{example_site_path}/
- end
- end
-
- describe 'email on push for a created branch' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
- let(:tree_path) { namespace_project_tree_path(project.namespace, project, "master") }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/heads/master', action: :create) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /Pushed new branch master/
- end
-
- it 'contains a link to the branch' do
- is_expected.to have_body_text /#{tree_path}/
- end
- end
-
- describe 'email on push for a created tag' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
- let(:tree_path) { namespace_project_tree_path(project.namespace, project, "v1.0") }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/tags/v1.0', action: :create) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /Pushed new tag v1\.0/
- end
-
- it 'contains a link to the tag' do
- is_expected.to have_body_text /#{tree_path}/
- end
- end
-
- describe 'email on push for a deleted branch' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/heads/master', action: :delete) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /Deleted branch master/
- end
- end
-
- describe 'email on push for a deleted tag' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/tags/v1.0', action: :delete) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /Deleted tag v1\.0/
- end
- end
-
- describe 'email on push with multiple commits' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
- let(:compare) { Gitlab::Git::Compare.new(project.repository.raw_repository, sample_image_commit.id, sample_commit.id) }
- let(:commits) { Commit.decorate(compare.commits) }
- let(:diff_path) { namespace_project_compare_path(project.namespace, project, from: Commit.new(compare.base), to: Commit.new(compare.head)) }
- let(:send_from_committer_email) { false }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/heads/master', action: :push, compare: compare, reverse_compare: false, send_from_committer_email: send_from_committer_email) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /\[#{project.path_with_namespace}\]\[master\] #{commits.length} commits:/
- end
-
- it 'includes commits list' do
- is_expected.to have_body_text /Change some files/
- end
-
- it 'includes diffs' do
- is_expected.to have_body_text /def archive_formats_regex/
- end
-
- it 'contains a link to the diff' do
- is_expected.to have_body_text /#{diff_path}/
- end
-
- it 'doesn not contain the misleading footer' do
- is_expected.not_to have_body_text /you are a member of/
- end
-
- context "when set to send from committer email if domain matches" do
-
- let(:send_from_committer_email) { true }
-
- before do
- allow(Gitlab.config.gitlab).to receive(:host).and_return("gitlab.corp.company.com")
- end
-
- context "when the committer email domain is within the GitLab domain" do
-
- before do
- user.update_attribute(:email, "user@company.com")
- user.confirm!
- end
-
- it "is sent from the committer email" do
- sender = subject.header[:from].addrs[0]
- expect(sender.address).to eq(user.email)
- end
-
- it "is set to reply to the committer email" do
- sender = subject.header[:reply_to].addrs[0]
- expect(sender.address).to eq(user.email)
- end
- end
-
- context "when the committer email domain is not completely within the GitLab domain" do
-
- before do
- user.update_attribute(:email, "user@something.company.com")
- user.confirm!
- end
-
- it "is sent from the default email" do
- sender = subject.header[:from].addrs[0]
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it "is set to reply to the default email" do
- sender = subject.header[:reply_to].addrs[0]
- expect(sender.address).to eq(gitlab_sender_reply_to)
- end
- end
-
- context "when the committer email domain is outside the GitLab domain" do
-
- before do
- user.update_attribute(:email, "user@mpany.com")
- user.confirm!
- end
-
- it "is sent from the default email" do
- sender = subject.header[:from].addrs[0]
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it "is set to reply to the default email" do
- sender = subject.header[:reply_to].addrs[0]
- expect(sender.address).to eq(gitlab_sender_reply_to)
- end
- end
- end
- end
-
- describe 'email on push with a single commit' do
- let(:example_site_path) { root_path }
- let(:user) { create(:user) }
- let(:compare) { Gitlab::Git::Compare.new(project.repository.raw_repository, sample_commit.parent_id, sample_commit.id) }
- let(:commits) { Commit.decorate(compare.commits) }
- let(:diff_path) { namespace_project_commit_path(project.namespace, project, commits.first) }
-
- subject { Notify.repository_push_email(project.id, 'devs@company.name', author_id: user.id, ref: 'refs/heads/master', action: :push, compare: compare) }
-
- it 'is sent as the author' do
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq(user.name)
- expect(sender.address).to eq(gitlab_sender)
- end
-
- it 'is sent to recipient' do
- is_expected.to deliver_to 'devs@company.name'
- end
-
- it 'has the correct subject' do
- is_expected.to have_subject /#{commits.first.title}/
- end
-
- it 'includes commits list' do
- is_expected.to have_body_text /Change some files/
- end
-
- it 'includes diffs' do
- is_expected.to have_body_text /def archive_formats_regex/
- end
-
- it 'contains a link to the diff' do
- is_expected.to have_body_text /#{diff_path}/
- end
- end
-end
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
deleted file mode 100644
index b4f0b2c201aba6f638f0a3d6762a0efd9c1dff25..0000000000000000000000000000000000000000
--- a/spec/models/application_setting_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# == Schema Information
-#
-# Table name: application_settings
-#
-# id :integer not null, primary key
-# default_projects_limit :integer
-# default_branch_protection :integer
-# signup_enabled :boolean
-# signin_enabled :boolean
-# gravatar_enabled :boolean
-# sign_in_text :text
-# created_at :datetime
-# updated_at :datetime
-# home_page_url :string(255)
-# default_branch_protection :integer default(2)
-# twitter_sharing_enabled :boolean default(TRUE)
-# restricted_visibility_levels :text
-#
-
-require 'spec_helper'
-
-describe ApplicationSetting, models: true do
- it { expect(ApplicationSetting.create_from_defaults).to be_valid }
-end
diff --git a/spec/models/broadcast_message_spec.rb b/spec/models/broadcast_message_spec.rb
deleted file mode 100644
index 8ab72151a690b1e37b60cffe94e0742955907f48..0000000000000000000000000000000000000000
--- a/spec/models/broadcast_message_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# == Schema Information
-#
-# Table name: broadcast_messages
-#
-# id :integer not null, primary key
-# message :text not null
-# starts_at :datetime
-# ends_at :datetime
-# alert_type :integer
-# created_at :datetime
-# updated_at :datetime
-# color :string(255)
-# font :string(255)
-#
-
-require 'spec_helper'
-
-describe BroadcastMessage do
- subject { create(:broadcast_message) }
-
- it { is_expected.to be_valid }
-
- describe :current do
- it "should return last message if time match" do
- broadcast_message = create(:broadcast_message, starts_at: Time.now.yesterday, ends_at: Time.now.tomorrow)
- expect(BroadcastMessage.current).to eq(broadcast_message)
- end
-
- it "should return nil if time not come" do
- broadcast_message = create(:broadcast_message, starts_at: Time.now.tomorrow, ends_at: Time.now + 2.days)
- expect(BroadcastMessage.current).to be_nil
- end
-
- it "should return nil if time has passed" do
- broadcast_message = create(:broadcast_message, starts_at: Time.now - 2.days, ends_at: Time.now.yesterday)
- expect(BroadcastMessage.current).to be_nil
- end
- end
-end
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
deleted file mode 100644
index 11cc7762ce4353dda61599129193b0678fb8b282..0000000000000000000000000000000000000000
--- a/spec/models/commit_spec.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'spec_helper'
-
-describe Commit do
- let(:project) { create :project }
- let(:commit) { project.repository.commit }
-
- describe '#title' do
- it "returns no_commit_message when safe_message is blank" do
- allow(commit).to receive(:safe_message).and_return('')
- expect(commit.title).to eq("--no commit message")
- end
-
- it "truncates a message without a newline at 80 characters" do
- message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
-
- allow(commit).to receive(:safe_message).and_return(message)
- expect(commit.title).to eq("#{message[0..79]}…")
- end
-
- it "truncates a message with a newline before 80 characters at the newline" do
- message = commit.safe_message.split(" ").first
-
- allow(commit).to receive(:safe_message).and_return(message + "\n" + message)
- expect(commit.title).to eq(message)
- end
-
- it "does not truncates a message with a newline after 80 but less 100 characters" do
- message =<(txt){ subject.stub(safe_message: txt) } }
-
- # Include the subject in the repository stub.
- let(:extra_commits) { [subject] }
- end
-end
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
deleted file mode 100644
index 557c71b4d2cecc2c8a28f2a57633fee4ef7051f3..0000000000000000000000000000000000000000
--- a/spec/models/concerns/issuable_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'spec_helper'
-
-describe Issue, "Issuable" do
- let(:issue) { create(:issue) }
-
- describe "Associations" do
- it { is_expected.to belong_to(:project) }
- it { is_expected.to belong_to(:author) }
- it { is_expected.to belong_to(:assignee) }
- it { is_expected.to have_many(:notes).dependent(:destroy) }
- end
-
- describe "Validation" do
- before { subject.stub(set_iid: false) }
- it { is_expected.to validate_presence_of(:project) }
- it { is_expected.to validate_presence_of(:iid) }
- it { is_expected.to validate_presence_of(:author) }
- it { is_expected.to validate_presence_of(:title) }
- it { is_expected.to ensure_length_of(:title).is_at_least(0).is_at_most(255) }
- end
-
- describe "Scope" do
- it { expect(described_class).to respond_to(:opened) }
- it { expect(described_class).to respond_to(:closed) }
- it { expect(described_class).to respond_to(:assigned) }
- end
-
- describe ".search" do
- let!(:searchable_issue) { create(:issue, title: "Searchable issue") }
-
- it "matches by title" do
- expect(described_class.search('able')).to eq([searchable_issue])
- end
- end
-
- describe "#today?" do
- it "returns true when created today" do
- # Avoid timezone differences and just return exactly what we want
- allow(Date).to receive(:today).and_return(issue.created_at.to_date)
- expect(issue.today?).to be_truthy
- end
-
- it "returns false when not created today" do
- allow(Date).to receive(:today).and_return(Date.yesterday)
- expect(issue.today?).to be_falsey
- end
- end
-
- describe "#new?" do
- it "returns true when created today and record hasn't been updated" do
- allow(issue).to receive(:today?).and_return(true)
- expect(issue.new?).to be_truthy
- end
-
- it "returns false when not created today" do
- allow(issue).to receive(:today?).and_return(false)
- expect(issue.new?).to be_falsey
- end
-
- it "returns false when record has been updated" do
- allow(issue).to receive(:today?).and_return(true)
- issue.touch
- expect(issue.new?).to be_falsey
- end
- end
-end
diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb
deleted file mode 100644
index eadb941a3fa8780eb5789e890760c9661295c89d..0000000000000000000000000000000000000000
--- a/spec/models/concerns/mentionable_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe Issue, "Mentionable" do
- describe :mentioned_users do
- let!(:user) { create(:user, username: 'stranger') }
- let!(:user2) { create(:user, username: 'john') }
- let!(:issue) { create(:issue, description: '@stranger mentioned') }
-
- subject { issue.mentioned_users }
-
- it { is_expected.to include(user) }
- it { is_expected.not_to include(user2) }
- end
-end
diff --git a/spec/models/deploy_key_spec.rb b/spec/models/deploy_key_spec.rb
deleted file mode 100644
index b32be8d7a7cb45199703192cf0c8d2f4fbcd8d55..0000000000000000000000000000000000000000
--- a/spec/models/deploy_key_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# == Schema Information
-#
-# Table name: keys
-#
-# id :integer not null, primary key
-# user_id :integer
-# created_at :datetime
-# updated_at :datetime
-# key :text
-# title :string(255)
-# type :string(255)
-# fingerprint :string(255)
-#
-
-require 'spec_helper'
-
-describe DeployKey do
- let(:project) { create(:project) }
- let(:deploy_key) { create(:deploy_key, projects: [project]) }
-
- describe "Associations" do
- it { is_expected.to have_many(:deploy_keys_projects) }
- it { is_expected.to have_many(:projects) }
- end
-end
diff --git a/spec/models/deploy_keys_project_spec.rb b/spec/models/deploy_keys_project_spec.rb
deleted file mode 100644
index 7032b777144d4d519e92a3ec3d620a3176c5c682..0000000000000000000000000000000000000000
--- a/spec/models/deploy_keys_project_spec.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-# == Schema Information
-#
-# Table name: deploy_keys_projects
-#
-# id :integer not null, primary key
-# deploy_key_id :integer not null
-# project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe DeployKeysProject do
- describe "Associations" do
- it { is_expected.to belong_to(:deploy_key) }
- it { is_expected.to belong_to(:project) }
- end
-
- describe "Validation" do
- it { is_expected.to validate_presence_of(:project_id) }
- it { is_expected.to validate_presence_of(:deploy_key_id) }
- end
-
- describe "Destroying" do
- let(:project) { create(:project) }
- subject { create(:deploy_keys_project, project: project) }
- let(:deploy_key) { subject.deploy_key }
-
- context "when the deploy key is only used by this project" do
- context "when the deploy key is public" do
- before do
- deploy_key.update_attribute(:public, true)
- end
-
- it "doesn't destroy the deploy key" do
- subject.destroy
-
- expect {
- deploy_key.reload
- }.not_to raise_error(ActiveRecord::RecordNotFound)
- end
- end
-
- context "when the deploy key is private" do
- it "destroys the deploy key" do
- subject.destroy
-
- expect {
- deploy_key.reload
- }.to raise_error(ActiveRecord::RecordNotFound)
- end
- end
- end
-
- context "when the deploy key is used by more than one project" do
- let!(:other_project) { create(:project) }
-
- before do
- other_project.deploy_keys << deploy_key
- end
-
- it "doesn't destroy the deploy key" do
- subject.destroy
-
- expect {
- deploy_key.reload
- }.not_to raise_error(ActiveRecord::RecordNotFound)
- end
- end
- end
-end
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
deleted file mode 100644
index 0f32f162a104b70ff3d124b0cf9fcece128b6b94..0000000000000000000000000000000000000000
--- a/spec/models/event_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# == Schema Information
-#
-# Table name: events
-#
-# id :integer not null, primary key
-# target_type :string(255)
-# target_id :integer
-# title :string(255)
-# data :text
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# action :integer
-# author_id :integer
-#
-
-require 'spec_helper'
-
-describe Event do
- describe "Associations" do
- it { is_expected.to belong_to(:project) }
- it { is_expected.to belong_to(:target) }
- end
-
- describe "Respond to" do
- it { is_expected.to respond_to(:author_name) }
- it { is_expected.to respond_to(:author_email) }
- it { is_expected.to respond_to(:issue_title) }
- it { is_expected.to respond_to(:merge_request_title) }
- it { is_expected.to respond_to(:commits) }
- end
-
- describe "Push event" do
- before do
- project = create(:project)
- @user = project.owner
-
- data = {
- before: Gitlab::Git::BLANK_SHA,
- after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
- ref: "refs/heads/master",
- user_id: @user.id,
- user_name: @user.name,
- repository: {
- name: project.name,
- url: "localhost/rubinius",
- description: "",
- homepage: "localhost/rubinius",
- private: true
- }
- }
-
- @event = Event.create(
- project: project,
- action: Event::PUSHED,
- data: data,
- author_id: @user.id
- )
- end
-
- it { expect(@event.push?).to be_truthy }
- it { expect(@event.proper?).to be_truthy }
- it { expect(@event.tag?).to be_falsey }
- it { expect(@event.branch_name).to eq("master") }
- it { expect(@event.author).to eq(@user) }
- end
-end
diff --git a/spec/models/external_wiki_service_spec.rb b/spec/models/external_wiki_service_spec.rb
deleted file mode 100644
index 78ef687d29cbeec644b45d8cc267e782939ae802..0000000000000000000000000000000000000000
--- a/spec/models/external_wiki_service_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'spec_helper'
-
-describe ExternalWikiService do
- include ExternalWikiHelper
- describe "Associations" do
- it { should belong_to :project }
- it { should have_one :service_hook }
- end
-
- describe "Validations" do
- context "active" do
- before do
- subject.active = true
- end
-
- it { should validate_presence_of :external_wiki_url }
- end
- end
-
- describe 'External wiki' do
- let(:project) { create(:project) }
-
- context 'when it is active' do
- before do
- properties = { 'external_wiki_url' => 'https://gitlab.com' }
- @service = project.create_external_wiki_service(active: true, properties: properties)
- end
-
- after do
- @service.destroy!
- end
-
- it 'should replace the wiki url' do
- wiki_path = get_project_wiki_path(project)
- wiki_path.should match('https://gitlab.com')
- end
- end
- end
-end
diff --git a/spec/models/forked_project_link_spec.rb b/spec/models/forked_project_link_spec.rb
deleted file mode 100644
index 7d0ad44a92c2ad1f4c072d6c3bc4bc81df6d3097..0000000000000000000000000000000000000000
--- a/spec/models/forked_project_link_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# == Schema Information
-#
-# Table name: forked_project_links
-#
-# id :integer not null, primary key
-# forked_to_project_id :integer not null
-# forked_from_project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe ForkedProjectLink, "add link on fork" do
- let(:project_from) { create(:project) }
- let(:namespace) { create(:namespace) }
- let(:user) { create(:user, namespace: namespace) }
-
- before do
- @project_to = fork_project(project_from, user)
- end
-
- it "project_to should know it is forked" do
- expect(@project_to.forked?).to be_truthy
- end
-
- it "project should know who it is forked from" do
- expect(@project_to.forked_from_project).to eq(project_from)
- end
-end
-
-describe :forked_from_project do
- let(:forked_project_link) { build(:forked_project_link) }
- let(:project_from) { create(:project) }
- let(:project_to) { create(:project, forked_project_link: forked_project_link) }
-
-
- before :each do
- forked_project_link.forked_from_project = project_from
- forked_project_link.forked_to_project = project_to
- forked_project_link.save!
- end
-
-
- it "project_to should know it is forked" do
- expect(project_to.forked?).to be_truthy
- end
-
- it "project_from should not be forked" do
- expect(project_from.forked?).to be_falsey
- end
-
- it "project_to.destroy should destroy fork_link" do
- expect(forked_project_link).to receive(:destroy)
- project_to.destroy
- end
-
-end
-
-def fork_project(from_project, user)
- context = Projects::ForkService.new(from_project, user)
- shell = double("gitlab_shell")
- shell.stub(fork_repository: true)
- context.stub(gitlab_shell: shell)
- context.execute
-end
-
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
deleted file mode 100644
index 9428224a64f9eba52a98ba773663002d1f4b3c0c..0000000000000000000000000000000000000000
--- a/spec/models/group_spec.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-# == Schema Information
-#
-# Table name: namespaces
-#
-# id :integer not null, primary key
-# name :string(255) not null
-# path :string(255) not null
-# owner_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255)
-# description :string(255) default(""), not null
-# avatar :string(255)
-#
-
-require 'spec_helper'
-
-describe Group do
- let!(:group) { create(:group) }
-
- describe "Associations" do
- it { is_expected.to have_many :projects }
- it { is_expected.to have_many :group_members }
- end
-
- it { is_expected.to validate_presence_of :name }
- it { is_expected.to validate_uniqueness_of(:name) }
- it { is_expected.to validate_presence_of :path }
- it { is_expected.to validate_uniqueness_of(:path) }
- it { is_expected.not_to validate_presence_of :owner }
-
- describe :users do
- it { expect(group.users).to eq(group.owners) }
- end
-
- describe :human_name do
- it { expect(group.human_name).to eq(group.name) }
- end
-
- describe :add_users do
- let(:user) { create(:user) }
- before { group.add_user(user, GroupMember::MASTER) }
-
- it { expect(group.group_members.masters.map(&:user)).to include(user) }
- end
-
- describe :add_users do
- let(:user) { create(:user) }
- before { group.add_users([user.id], GroupMember::GUEST) }
-
- it "should update the group permission" do
- expect(group.group_members.guests.map(&:user)).to include(user)
- group.add_users([user.id], GroupMember::DEVELOPER)
- expect(group.group_members.developers.map(&:user)).to include(user)
- expect(group.group_members.guests.map(&:user)).not_to include(user)
- end
- end
-
- describe :avatar_type do
- let(:user) { create(:user) }
- before { group.add_user(user, GroupMember::MASTER) }
-
- it "should be true if avatar is image" do
- group.update_attribute(:avatar, 'uploads/avatar.png')
- expect(group.avatar_type).to be_truthy
- end
-
- it "should be false if avatar is html page" do
- group.update_attribute(:avatar, 'uploads/avatar.html')
- expect(group.avatar_type).to eq(["only images allowed"])
- end
- end
-end
diff --git a/spec/models/hooks/project_hook_spec.rb b/spec/models/hooks/project_hook_spec.rb
deleted file mode 100644
index 4e0d50d7f3f6ec1d273b807235ae605d6c2013c4..0000000000000000000000000000000000000000
--- a/spec/models/hooks/project_hook_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255) default("ProjectHook")
-# service_id :integer
-# push_events :boolean default(TRUE), not null
-# issues_events :boolean default(FALSE), not null
-# merge_requests_events :boolean default(FALSE), not null
-# tag_push_events :boolean default(FALSE)
-#
-
-require 'spec_helper'
-
-describe ProjectHook do
- describe '.push_hooks' do
- it 'should return hooks for push events only' do
- hook = create(:project_hook, push_events: true)
- hook2 = create(:project_hook, push_events: false)
- expect(ProjectHook.push_hooks).to eq([hook])
- end
- end
-
- describe '.tag_push_hooks' do
- it 'should return hooks for tag push events only' do
- hook = create(:project_hook, tag_push_events: true)
- hook2 = create(:project_hook, tag_push_events: false)
- expect(ProjectHook.tag_push_hooks).to eq([hook])
- end
- end
-end
diff --git a/spec/models/hooks/service_hook_spec.rb b/spec/models/hooks/service_hook_spec.rb
deleted file mode 100644
index 96bf74d45da7589495953ae9ca71598c8cd0d66d..0000000000000000000000000000000000000000
--- a/spec/models/hooks/service_hook_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255) default("ProjectHook")
-# service_id :integer
-# push_events :boolean default(TRUE), not null
-# issues_events :boolean default(FALSE), not null
-# merge_requests_events :boolean default(FALSE), not null
-# tag_push_events :boolean default(FALSE)
-#
-
-require "spec_helper"
-
-describe ServiceHook do
- describe "Associations" do
- it { is_expected.to belong_to :service }
- end
-end
diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb
deleted file mode 100644
index 810b311a40bbc24d60af228bf9a4aa57ec34d375..0000000000000000000000000000000000000000
--- a/spec/models/hooks/system_hook_spec.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255) default("ProjectHook")
-# service_id :integer
-# push_events :boolean default(TRUE), not null
-# issues_events :boolean default(FALSE), not null
-# merge_requests_events :boolean default(FALSE), not null
-# tag_push_events :boolean default(FALSE)
-#
-
-require "spec_helper"
-
-describe SystemHook do
- describe "execute" do
- before(:each) do
- @system_hook = create(:system_hook)
- WebMock.stub_request(:post, @system_hook.url)
- end
-
- it "project_create hook" do
- Projects::CreateService.new(create(:user), name: 'empty').execute
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /project_create/).once
- end
-
- it "project_destroy hook" do
- user = create(:user)
- project = create(:empty_project, namespace: user.namespace)
- Projects::DestroyService.new(project, user, {}).execute
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /project_destroy/).once
- end
-
- it "user_create hook" do
- create(:user)
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /user_create/).once
- end
-
- it "user_destroy hook" do
- user = create(:user)
- user.destroy
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /user_destroy/).once
- end
-
- it "project_create hook" do
- user = create(:user)
- project = create(:project)
- project.team << [user, :master]
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /user_add_to_team/).once
- end
-
- it "project_destroy hook" do
- user = create(:user)
- project = create(:project)
- project.team << [user, :master]
- project.project_members.destroy_all
- expect(WebMock).to have_requested(:post, @system_hook.url).with(body: /user_remove_from_team/).once
- end
-
- it 'group create hook' do
- create(:group)
- expect(WebMock).to have_requested(:post, @system_hook.url).with(
- body: /group_create/
- ).once
- end
-
- it 'group destroy hook' do
- group = create(:group)
- group.destroy
- expect(WebMock).to have_requested(:post, @system_hook.url).with(
- body: /group_destroy/
- ).once
- end
-
- it 'group member create hook' do
- group = create(:group)
- user = create(:user)
- group.add_user(user, Gitlab::Access::MASTER)
- expect(WebMock).to have_requested(:post, @system_hook.url).with(
- body: /user_add_to_group/
- ).once
- end
-
- it 'group member destroy hook' do
- group = create(:group)
- user = create(:user)
- group.add_user(user, Gitlab::Access::MASTER)
- group.group_members.destroy_all
- expect(WebMock).to have_requested(:post, @system_hook.url).with(
- body: /user_remove_from_group/
- ).once
- end
-
- end
-end
diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb
deleted file mode 100644
index 67ec9193ad7db5daa111c11a1fbcfca249bd1567..0000000000000000000000000000000000000000
--- a/spec/models/hooks/web_hook_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-# == Schema Information
-#
-# Table name: web_hooks
-#
-# id :integer not null, primary key
-# url :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255) default("ProjectHook")
-# service_id :integer
-# push_events :boolean default(TRUE), not null
-# issues_events :boolean default(FALSE), not null
-# merge_requests_events :boolean default(FALSE), not null
-# tag_push_events :boolean default(FALSE)
-#
-
-require 'spec_helper'
-
-describe ProjectHook do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validations" do
- it { is_expected.to validate_presence_of(:url) }
-
- context "url format" do
- it { is_expected.to allow_value("http://example.com").for(:url) }
- it { is_expected.to allow_value("https://excample.com").for(:url) }
- it { is_expected.to allow_value("http://test.com/api").for(:url) }
- it { is_expected.to allow_value("http://test.com/api?key=abc").for(:url) }
- it { is_expected.to allow_value("http://test.com/api?key=abc&type=def").for(:url) }
-
- it { is_expected.not_to allow_value("example.com").for(:url) }
- it { is_expected.not_to allow_value("ftp://example.com").for(:url) }
- it { is_expected.not_to allow_value("herp-and-derp").for(:url) }
- end
- end
-
- describe "execute" do
- before(:each) do
- @project_hook = create(:project_hook)
- @project = create(:project)
- @project.hooks << [@project_hook]
- @data = { before: 'oldrev', after: 'newrev', ref: 'ref'}
-
- WebMock.stub_request(:post, @project_hook.url)
- end
-
- it "POSTs to the web hook URL" do
- @project_hook.execute(@data)
- expect(WebMock).to have_requested(:post, @project_hook.url).once
- end
-
- it "POSTs the data as JSON" do
- json = @data.to_json
-
- @project_hook.execute(@data)
- expect(WebMock).to have_requested(:post, @project_hook.url).with(body: json).once
- end
-
- it "catches exceptions" do
- expect(WebHook).to receive(:post).and_raise("Some HTTP Post error")
-
- expect {
- @project_hook.execute(@data)
- }.to raise_error
- end
- end
-end
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
deleted file mode 100644
index 087e40c3d840e86faa9ca49049282d6d2cc1d0b3..0000000000000000000000000000000000000000
--- a/spec/models/issue_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# == Schema Information
-#
-# Table name: issues
-#
-# id :integer not null, primary key
-# title :string(255)
-# assignee_id :integer
-# author_id :integer
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# position :integer default(0)
-# branch_name :string(255)
-# description :text
-# milestone_id :integer
-# state :string(255)
-# iid :integer
-#
-
-require 'spec_helper'
-
-describe Issue do
- describe "Associations" do
- it { is_expected.to belong_to(:milestone) }
- end
-
- describe "Mass assignment" do
- end
-
- describe 'modules' do
- it { is_expected.to include_module(Issuable) }
- end
-
- subject { create(:issue) }
-
- describe '#is_being_reassigned?' do
- it 'returns true if the issue assignee has changed' do
- subject.assignee = create(:user)
- expect(subject.is_being_reassigned?).to be_truthy
- end
- it 'returns false if the issue assignee has not changed' do
- expect(subject.is_being_reassigned?).to be_falsey
- end
- end
-
- describe '#is_being_reassigned?' do
- it 'returns issues assigned to user' do
- user = create :user
-
- 2.times do
- issue = create :issue, assignee: user
- end
-
- expect(Issue.open_for(user).count).to eq 2
- end
- end
-
- it_behaves_like 'an editable mentionable' do
- let(:subject) { create :issue, project: mproject }
- let(:backref_text) { "issue ##{subject.iid}" }
- let(:set_mentionable_text) { ->(txt){ subject.description = txt } }
- end
-
- it_behaves_like 'a Taskable' do
- let(:subject) { create :issue }
- end
-end
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
deleted file mode 100644
index 2fb651bef1b2e15235040cc3a2ed66229a21a653..0000000000000000000000000000000000000000
--- a/spec/models/key_spec.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# == Schema Information
-#
-# Table name: keys
-#
-# id :integer not null, primary key
-# user_id :integer
-# created_at :datetime
-# updated_at :datetime
-# key :text
-# title :string(255)
-# type :string(255)
-# fingerprint :string(255)
-#
-
-require 'spec_helper'
-
-describe Key do
- describe "Associations" do
- it { is_expected.to belong_to(:user) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- it { is_expected.to validate_presence_of(:title) }
- it { is_expected.to validate_presence_of(:key) }
- it { is_expected.to ensure_length_of(:title).is_within(0..255) }
- it { is_expected.to ensure_length_of(:key).is_within(0..5000) }
- end
-
- describe "Methods" do
- it { is_expected.to respond_to :projects }
- end
-
- context "validation of uniqueness" do
- let(:user) { create(:user) }
-
- it "accepts the key once" do
- expect(build(:key, user: user)).to be_valid
- end
-
- it "does not accept the exact same key twice" do
- create(:key, user: user)
- expect(build(:key, user: user)).not_to be_valid
- end
-
- it "does not accept a duplicate key with a different comment" do
- create(:key, user: user)
- duplicate = build(:key, user: user)
- duplicate.key << ' extra comment'
- expect(duplicate).not_to be_valid
- end
- end
-
- context "validate it is a fingerprintable key" do
- it "accepts the fingerprintable key" do
- expect(build(:key)).to be_valid
- end
-
- it 'rejects an unfingerprintable key that contains a space' do
- key = build(:key)
-
- # Not always the middle, but close enough
- key.key = key.key[0..100] + ' ' + key.key[100..-1]
-
- expect(key).not_to be_valid
- end
-
- it 'rejects the unfingerprintable key (not a key)' do
- expect(build(:key, key: 'ssh-rsa an-invalid-key==')).not_to be_valid
- end
- end
-
- context 'callbacks' do
- it 'should add new key to authorized_file' do
- @key = build(:personal_key, id: 7)
- expect(GitlabShellWorker).to receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
- @key.save
- end
-
- it 'should remove key from authorized_file' do
- @key = create(:personal_key)
- expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
- @key.destroy
- end
- end
-end
diff --git a/spec/models/label_link_spec.rb b/spec/models/label_link_spec.rb
deleted file mode 100644
index 8c240826582807ad8614fc75602e4d9e7f2a0f9b..0000000000000000000000000000000000000000
--- a/spec/models/label_link_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# == Schema Information
-#
-# Table name: label_links
-#
-# id :integer not null, primary key
-# label_id :integer
-# target_id :integer
-# target_type :string(255)
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe LabelLink do
- let(:label) { create(:label_link) }
- it { expect(label).to be_valid }
-
- it { is_expected.to belong_to(:label) }
- it { is_expected.to belong_to(:target) }
-end
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb
deleted file mode 100644
index 8644ac46605af0a17c6e4c43e3254a510d9f971b..0000000000000000000000000000000000000000
--- a/spec/models/label_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# == Schema Information
-#
-# Table name: labels
-#
-# id :integer not null, primary key
-# title :string(255)
-# color :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe Label do
- let(:label) { create(:label) }
- it { expect(label).to be_valid }
-
- it { is_expected.to belong_to(:project) }
-
- describe 'Validation' do
- it 'should validate color code' do
- expect(build(:label, color: 'G-ITLAB')).not_to be_valid
- expect(build(:label, color: 'AABBCC')).not_to be_valid
- expect(build(:label, color: '#AABBCCEE')).not_to be_valid
- expect(build(:label, color: '#GGHHII')).not_to be_valid
- expect(build(:label, color: '#')).not_to be_valid
- expect(build(:label, color: '')).not_to be_valid
-
- expect(build(:label, color: '#AABBCC')).to be_valid
- end
-
- it 'should validate title' do
- expect(build(:label, title: 'G,ITLAB')).not_to be_valid
- expect(build(:label, title: 'G?ITLAB')).not_to be_valid
- expect(build(:label, title: 'G&ITLAB')).not_to be_valid
- expect(build(:label, title: '')).not_to be_valid
-
- expect(build(:label, title: 'GITLAB')).to be_valid
- expect(build(:label, title: 'gitlab')).to be_valid
- end
- end
-end
diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb
deleted file mode 100644
index 56d030a03b35a7bd6d1538e1ecde1b93f80518c1..0000000000000000000000000000000000000000
--- a/spec/models/member_spec.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-require 'spec_helper'
-
-describe Member do
- describe "Associations" do
- it { is_expected.to belong_to(:user) }
- end
-
- describe "Validation" do
- subject { Member.new(access_level: Member::GUEST) }
-
- it { is_expected.to validate_presence_of(:user) }
- it { is_expected.to validate_presence_of(:source) }
- it { is_expected.to validate_inclusion_of(:access_level).in_array(Gitlab::Access.values) }
-
- context "when an invite email is provided" do
- let(:member) { build(:project_member, invite_email: "user@example.com", user: nil) }
-
- it "doesn't require a user" do
- expect(member).to be_valid
- end
-
- it "requires a valid invite email" do
- member.invite_email = "nope"
-
- expect(member).not_to be_valid
- end
-
- it "requires a unique invite email scoped to this source" do
- create(:project_member, source: member.source, invite_email: member.invite_email)
-
- expect(member).not_to be_valid
- end
-
- it "is valid otherwise" do
- expect(member).to be_valid
- end
- end
-
- context "when an invite email is not provided" do
- let(:member) { build(:project_member) }
-
- it "requires a user" do
- member.user = nil
-
- expect(member).not_to be_valid
- end
-
- it "is valid otherwise" do
- expect(member).to be_valid
- end
- end
- end
-
- describe "Delegate methods" do
- it { is_expected.to respond_to(:user_name) }
- it { is_expected.to respond_to(:user_email) }
- end
-
- describe ".add_user" do
- let!(:user) { create(:user) }
- let(:project) { create(:project) }
-
- context "when called with a user id" do
- it "adds the user as a member" do
- Member.add_user(project.project_members, user.id, ProjectMember::MASTER)
-
- expect(project.users).to include(user)
- end
- end
-
- context "when called with a user object" do
- it "adds the user as a member" do
- Member.add_user(project.project_members, user, ProjectMember::MASTER)
-
- expect(project.users).to include(user)
- end
- end
-
- context "when called with a known user email" do
- it "adds the user as a member" do
- Member.add_user(project.project_members, user.email, ProjectMember::MASTER)
-
- expect(project.users).to include(user)
- end
- end
-
- context "when called with an unknown user email" do
- it "adds a member invite" do
- Member.add_user(project.project_members, "user@example.com", ProjectMember::MASTER)
-
- expect(project.project_members.invite.pluck(:invite_email)).to include("user@example.com")
- end
- end
- end
-
- describe "#accept_invite!" do
- let!(:member) { create(:project_member, invite_email: "user@example.com", user: nil) }
- let(:user) { create(:user) }
-
- it "resets the invite token" do
- member.accept_invite!(user)
-
- expect(member.invite_token).to be_nil
- end
-
- it "sets the invite accepted timestamp" do
- member.accept_invite!(user)
-
- expect(member.invite_accepted_at).not_to be_nil
- end
-
- it "sets the user" do
- member.accept_invite!(user)
-
- expect(member.user).to eq(user)
- end
-
- it "calls #after_accept_invite" do
- expect(member).to receive(:after_accept_invite)
-
- member.accept_invite!(user)
- end
- end
-
- describe "#decline_invite!" do
- let!(:member) { create(:project_member, invite_email: "user@example.com", user: nil) }
-
- it "destroys the member" do
- member.decline_invite!
-
- expect(member).to be_destroyed
- end
-
- it "calls #after_decline_invite" do
- expect(member).to receive(:after_decline_invite)
-
- member.decline_invite!
- end
- end
-
- describe "#generate_invite_token" do
- let!(:member) { create(:project_member, invite_email: "user@example.com", user: nil) }
-
- it "sets the invite token" do
- expect { member.generate_invite_token }.to change { member.invite_token}
- end
- end
-end
diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb
deleted file mode 100644
index e206c11f33ae43bb117f1d899307cd60de1a8e08..0000000000000000000000000000000000000000
--- a/spec/models/members/group_member_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# == Schema Information
-#
-# Table name: members
-#
-# id :integer not null, primary key
-# access_level :integer not null
-# source_id :integer not null
-# source_type :string(255) not null
-# user_id :integer not null
-# notification_level :integer not null
-# type :string(255)
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe GroupMember do
- context 'notification' do
- describe "#after_create" do
- it "should send email to user" do
- membership = build(:group_member)
- membership.stub(notification_service: double('NotificationService').as_null_object)
- expect(membership).to receive(:notification_service)
- membership.save
- end
- end
-
- describe "#after_update" do
- before do
- @group_member = create :group_member
- @group_member.stub(notification_service: double('NotificationService').as_null_object)
- end
-
- it "should send email to user" do
- expect(@group_member).to receive(:notification_service)
- @group_member.update_attribute(:access_level, GroupMember::MASTER)
- end
-
- it "does not send an email when the access level has not changed" do
- expect(@group_member).not_to receive(:notification_service)
- @group_member.update_attribute(:access_level, GroupMember::OWNER)
- end
- end
- end
-end
diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb
deleted file mode 100644
index 521721f3577ee2cba82abdc7c9b4a88fe3131ee7..0000000000000000000000000000000000000000
--- a/spec/models/members/project_member_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-# == Schema Information
-#
-# Table name: members
-#
-# id :integer not null, primary key
-# access_level :integer not null
-# source_id :integer not null
-# source_type :string(255) not null
-# user_id :integer not null
-# notification_level :integer not null
-# type :string(255)
-# created_at :datetime
-# updated_at :datetime
-#
-
-require 'spec_helper'
-
-describe ProjectMember do
- describe :import_team do
- before do
- @abilities = Six.new
- @abilities << Ability
-
- @project_1 = create :project
- @project_2 = create :project
-
- @user_1 = create :user
- @user_2 = create :user
-
- @project_1.team << [ @user_1, :developer ]
- @project_2.team << [ @user_2, :reporter ]
-
- @status = @project_2.team.import(@project_1)
- end
-
- it { expect(@status).to be_truthy }
-
- describe 'project 2 should get user 1 as developer. user_2 should not be changed' do
- it { expect(@project_2.users).to include(@user_1) }
- it { expect(@project_2.users).to include(@user_2) }
-
- it { expect(@abilities.allowed?(@user_1, :write_project, @project_2)).to be_truthy }
- it { expect(@abilities.allowed?(@user_2, :read_project, @project_2)).to be_truthy }
- end
-
- describe 'project 1 should not be changed' do
- it { expect(@project_1.users).to include(@user_1) }
- it { expect(@project_1.users).not_to include(@user_2) }
- end
- end
-
- describe :add_users_into_projects do
- before do
- @project_1 = create :project
- @project_2 = create :project
-
- @user_1 = create :user
- @user_2 = create :user
-
- ProjectMember.add_users_into_projects(
- [@project_1.id, @project_2.id],
- [@user_1.id, @user_2.id],
- ProjectMember::MASTER
- )
- end
-
- it { expect(@project_1.users).to include(@user_1) }
- it { expect(@project_1.users).to include(@user_2) }
-
-
- it { expect(@project_2.users).to include(@user_1) }
- it { expect(@project_2.users).to include(@user_2) }
- end
-
- describe :truncate_teams do
- before do
- @project_1 = create :project
- @project_2 = create :project
-
- @user_1 = create :user
- @user_2 = create :user
-
- @project_1.team << [ @user_1, :developer]
- @project_2.team << [ @user_2, :reporter]
-
- ProjectMember.truncate_teams([@project_1.id, @project_2.id])
- end
-
- it { expect(@project_1.users).to be_empty }
- it { expect(@project_2.users).to be_empty }
- end
-end
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
deleted file mode 100644
index d40503d791cad7a6c6f8ab9a8b4fbd18a933020b..0000000000000000000000000000000000000000
--- a/spec/models/merge_request_spec.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-# == Schema Information
-#
-# Table name: merge_requests
-#
-# id :integer not null, primary key
-# target_branch :string(255) not null
-# source_branch :string(255) not null
-# source_project_id :integer not null
-# author_id :integer
-# assignee_id :integer
-# title :string(255)
-# created_at :datetime
-# updated_at :datetime
-# milestone_id :integer
-# state :string(255)
-# merge_status :string(255)
-# target_project_id :integer not null
-# iid :integer
-# description :text
-# position :integer default(0)
-# locked_at :datetime
-#
-
-require 'spec_helper'
-
-describe MergeRequest do
- describe "Validation" do
- it { is_expected.to validate_presence_of(:target_branch) }
- it { is_expected.to validate_presence_of(:source_branch) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Respond to" do
- it { is_expected.to respond_to(:unchecked?) }
- it { is_expected.to respond_to(:can_be_merged?) }
- it { is_expected.to respond_to(:cannot_be_merged?) }
- end
-
- describe 'modules' do
- it { is_expected.to include_module(Issuable) }
- end
-
- describe "#mr_and_commit_notes" do
- let!(:merge_request) { create(:merge_request) }
-
- before do
- allow(merge_request).to receive(:commits) { [merge_request.source_project.repository.commit] }
- create(:note, commit_id: merge_request.commits.first.id, noteable_type: 'Commit', project: merge_request.project)
- create(:note, noteable: merge_request, project: merge_request.project)
- end
-
- it "should include notes for commits" do
- expect(merge_request.commits).not_to be_empty
- expect(merge_request.mr_and_commit_notes.count).to eq(2)
- end
- end
-
- subject { create(:merge_request) }
-
- describe '#is_being_reassigned?' do
- it 'returns true if the merge_request assignee has changed' do
- subject.assignee = create(:user)
- expect(subject.is_being_reassigned?).to be_truthy
- end
- it 'returns false if the merge request assignee has not changed' do
- expect(subject.is_being_reassigned?).to be_falsey
- end
- end
-
- describe '#for_fork?' do
- it 'returns true if the merge request is for a fork' do
- subject.source_project = create(:project, namespace: create(:group))
- subject.target_project = create(:project, namespace: create(:group))
-
- expect(subject.for_fork?).to be_truthy
- end
-
- it 'returns false if is not for a fork' do
- expect(subject.for_fork?).to be_falsey
- end
- end
-
- describe 'detection of issues to be closed' do
- let(:issue0) { create :issue, project: subject.project }
- let(:issue1) { create :issue, project: subject.project }
- let(:commit0) { double('commit0', closes_issues: [issue0]) }
- let(:commit1) { double('commit1', closes_issues: [issue0]) }
- let(:commit2) { double('commit2', closes_issues: [issue1]) }
-
- before do
- subject.stub(commits: [commit0, commit1, commit2])
- end
-
- it 'accesses the set of issues that will be closed on acceptance' do
- subject.project.stub(default_branch: subject.target_branch)
-
- expect(subject.closes_issues).to eq([issue0, issue1].sort_by(&:id))
- end
-
- it 'only lists issues as to be closed if it targets the default branch' do
- subject.project.stub(default_branch: 'master')
- subject.target_branch = 'something-else'
-
- expect(subject.closes_issues).to be_empty
- end
-
- it 'detects issues mentioned in the description' do
- issue2 = create(:issue, project: subject.project)
- subject.description = "Closes ##{issue2.iid}"
- subject.project.stub(default_branch: subject.target_branch)
-
- expect(subject.closes_issues).to include(issue2)
- end
- end
-
- it_behaves_like 'an editable mentionable' do
- let(:subject) { create :merge_request, source_project: mproject, target_project: mproject }
- let(:backref_text) { "merge request !#{subject.iid}" }
- let(:set_mentionable_text) { ->(txt){ subject.title = txt } }
- end
-
- it_behaves_like 'a Taskable' do
- let(:subject) { create :merge_request, :simple }
- end
-end
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
deleted file mode 100644
index 45171e1bf6459a35e4b7c0a4e227cdfc2b9d69f4..0000000000000000000000000000000000000000
--- a/spec/models/milestone_spec.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-# == Schema Information
-#
-# Table name: milestones
-#
-# id :integer not null, primary key
-# title :string(255) not null
-# project_id :integer not null
-# description :text
-# due_date :date
-# created_at :datetime
-# updated_at :datetime
-# state :string(255)
-# iid :integer
-#
-
-require 'spec_helper'
-
-describe Milestone do
- describe "Associations" do
- it { is_expected.to belong_to(:project) }
- it { is_expected.to have_many(:issues) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- before { subject.stub(set_iid: false) }
- it { is_expected.to validate_presence_of(:title) }
- it { is_expected.to validate_presence_of(:project) }
- end
-
- let(:milestone) { create(:milestone) }
- let(:issue) { create(:issue) }
-
- describe "#percent_complete" do
- it "should not count open issues" do
- milestone.issues << issue
- expect(milestone.percent_complete).to eq(0)
- end
-
- it "should count closed issues" do
- issue.close
- milestone.issues << issue
- expect(milestone.percent_complete).to eq(100)
- end
-
- it "should recover from dividing by zero" do
- expect(milestone.issues).to receive(:count).and_return(0)
- expect(milestone.percent_complete).to eq(100)
- end
- end
-
- describe "#expires_at" do
- it "should be nil when due_date is unset" do
- milestone.update_attributes(due_date: nil)
- expect(milestone.expires_at).to be_nil
- end
-
- it "should not be nil when due_date is set" do
- milestone.update_attributes(due_date: Date.tomorrow)
- expect(milestone.expires_at).to be_present
- end
- end
-
- describe :expired? do
- context "expired" do
- before do
- milestone.stub(due_date: Date.today.prev_year)
- end
-
- it { expect(milestone.expired?).to be_truthy }
- end
-
- context "not expired" do
- before do
- milestone.stub(due_date: Date.today.next_year)
- end
-
- it { expect(milestone.expired?).to be_falsey }
- end
- end
-
- describe :percent_complete do
- before do
- milestone.stub(
- closed_items_count: 3,
- total_items_count: 4
- )
- end
-
- it { expect(milestone.percent_complete).to eq(75) }
- end
-
- describe :items_count do
- before do
- milestone.issues << create(:issue)
- milestone.issues << create(:closed_issue)
- milestone.merge_requests << create(:merge_request)
- end
-
- it { expect(milestone.closed_items_count).to eq(1) }
- it { expect(milestone.open_items_count).to eq(2) }
- it { expect(milestone.total_items_count).to eq(3) }
- it { expect(milestone.is_empty?).to be_falsey }
- end
-
- describe :can_be_closed? do
- it { expect(milestone.can_be_closed?).to be_truthy }
- end
-
- describe :is_empty? do
- before do
- issue = create :closed_issue, milestone: milestone
- merge_request = create :merge_request, milestone: milestone
- end
-
- it 'Should return total count of issues and merge requests assigned to milestone' do
- expect(milestone.total_items_count).to eq 2
- end
- end
-
- describe :can_be_closed? do
- before do
- milestone = create :milestone
- create :closed_issue, milestone: milestone
-
- issue = create :issue
- end
-
- it 'should be true if milestone active and all nested issues closed' do
- expect(milestone.can_be_closed?).to be_truthy
- end
-
- it 'should be false if milestone active and not all nested issues closed' do
- issue.milestone = milestone
- issue.save
-
- expect(milestone.can_be_closed?).to be_falsey
- end
- end
-
-end
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
deleted file mode 100644
index e87432fdf6263663d56cf6a7d69afc47d47eab0d..0000000000000000000000000000000000000000
--- a/spec/models/namespace_spec.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-# == Schema Information
-#
-# Table name: namespaces
-#
-# id :integer not null, primary key
-# name :string(255) not null
-# path :string(255) not null
-# owner_id :integer
-# created_at :datetime
-# updated_at :datetime
-# type :string(255)
-# description :string(255) default(""), not null
-# avatar :string(255)
-#
-
-require 'spec_helper'
-
-describe Namespace do
- let!(:namespace) { create(:namespace) }
-
- it { is_expected.to have_many :projects }
- it { is_expected.to validate_presence_of :name }
- it { is_expected.to validate_uniqueness_of(:name) }
- it { is_expected.to validate_presence_of :path }
- it { is_expected.to validate_uniqueness_of(:path) }
- it { is_expected.to validate_presence_of :owner }
-
- describe "Mass assignment" do
- end
-
- describe "Respond to" do
- it { is_expected.to respond_to(:human_name) }
- it { is_expected.to respond_to(:to_param) }
- end
-
- describe :to_param do
- it { expect(namespace.to_param).to eq(namespace.path) }
- end
-
- describe :human_name do
- it { expect(namespace.human_name).to eq(namespace.owner_name) }
- end
-
- describe :search do
- before do
- @namespace = create :namespace
- end
-
- it { expect(Namespace.search(@namespace.path)).to eq([@namespace]) }
- it { expect(Namespace.search('unknown')).to eq([]) }
- end
-
- describe :move_dir do
- before do
- @namespace = create :namespace
- @namespace.stub(path_changed?: true)
- end
-
- it "should raise error when directory exists" do
- expect { @namespace.move_dir }.to raise_error("namespace directory cannot be moved")
- end
-
- it "should move dir if path changed" do
- new_path = @namespace.path + "_new"
- @namespace.stub(path_was: @namespace.path)
- @namespace.stub(path: new_path)
- expect(@namespace.move_dir).to be_truthy
- end
- end
-
- describe :rm_dir do
- it "should remove dir" do
- expect(namespace.rm_dir).to be_truthy
- end
- end
-
- describe :find_by_path_or_name do
- before do
- @namespace = create(:namespace, name: 'WoW', path: 'woW')
- end
-
- it { expect(Namespace.find_by_path_or_name('wow')).to eq(@namespace) }
- it { expect(Namespace.find_by_path_or_name('WOW')).to eq(@namespace) }
- it { expect(Namespace.find_by_path_or_name('unknown')).to eq(nil) }
- end
-
- describe ".clean_path" do
-
- let!(:user) { create(:user, username: "johngitlab-etc") }
- let!(:namespace) { create(:namespace, path: "JohnGitLab-etc1") }
-
- it "cleans the path and makes sure it's available" do
- expect(Namespace.clean_path("-john+gitlab-ETC%.git@gmail.com")).to eq("johngitlab-ETC2")
- end
- end
-end
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
deleted file mode 100644
index a7bf5081d5b8a9c98176301132c712ab8e5823de..0000000000000000000000000000000000000000
--- a/spec/models/note_spec.rb
+++ /dev/null
@@ -1,637 +0,0 @@
-# == Schema Information
-#
-# Table name: notes
-#
-# id :integer not null, primary key
-# note :text
-# noteable_type :string(255)
-# author_id :integer
-# created_at :datetime
-# updated_at :datetime
-# project_id :integer
-# attachment :string(255)
-# line_code :string(255)
-# commit_id :string(255)
-# noteable_id :integer
-# system :boolean default(FALSE), not null
-# st_diff :text
-#
-
-require 'spec_helper'
-
-describe Note do
- describe "Associations" do
- it { is_expected.to belong_to(:project) }
- it { is_expected.to belong_to(:noteable) }
- it { is_expected.to belong_to(:author).class_name('User') }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- it { is_expected.to validate_presence_of(:note) }
- it { is_expected.to validate_presence_of(:project) }
- end
-
- describe "Voting score" do
- let(:project) { create(:project) }
-
- it "recognizes a neutral note" do
- note = create(:votable_note, note: "This is not a +1 note")
- expect(note).not_to be_upvote
- expect(note).not_to be_downvote
- end
-
- it "recognizes a neutral emoji note" do
- note = build(:votable_note, note: "I would :+1: this, but I don't want to")
- expect(note).not_to be_upvote
- expect(note).not_to be_downvote
- end
-
- it "recognizes a +1 note" do
- note = create(:votable_note, note: "+1 for this")
- expect(note).to be_upvote
- end
-
- it "recognizes a +1 emoji as a vote" do
- note = build(:votable_note, note: ":+1: for this")
- expect(note).to be_upvote
- end
-
- it "recognizes a thumbsup emoji as a vote" do
- note = build(:votable_note, note: ":thumbsup: for this")
- expect(note).to be_upvote
- end
-
- it "recognizes a -1 note" do
- note = create(:votable_note, note: "-1 for this")
- expect(note).to be_downvote
- end
-
- it "recognizes a -1 emoji as a vote" do
- note = build(:votable_note, note: ":-1: for this")
- expect(note).to be_downvote
- end
-
- it "recognizes a thumbsdown emoji as a vote" do
- note = build(:votable_note, note: ":thumbsdown: for this")
- expect(note).to be_downvote
- end
- end
-
- let(:project) { create(:project) }
-
- describe "Commit notes" do
- let!(:note) { create(:note_on_commit, note: "+1 from me") }
- let!(:commit) { note.noteable }
-
- it "should be accessible through #noteable" do
- expect(note.commit_id).to eq(commit.id)
- expect(note.noteable).to be_a(Commit)
- expect(note.noteable).to eq(commit)
- end
-
- it "should save a valid note" do
- expect(note.commit_id).to eq(commit.id)
- note.noteable == commit
- end
-
- it "should be recognized by #for_commit?" do
- expect(note).to be_for_commit
- end
-
- it "should not be votable" do
- expect(note).not_to be_votable
- end
- end
-
- describe "Commit diff line notes" do
- let!(:note) { create(:note_on_commit_diff, note: "+1 from me") }
- let!(:commit) { note.noteable }
-
- it "should save a valid note" do
- expect(note.commit_id).to eq(commit.id)
- expect(note.noteable.id).to eq(commit.id)
- end
-
- it "should be recognized by #for_diff_line?" do
- expect(note).to be_for_diff_line
- end
-
- it "should be recognized by #for_commit_diff_line?" do
- expect(note).to be_for_commit_diff_line
- end
-
- it "should not be votable" do
- expect(note).not_to be_votable
- end
- end
-
- describe "Issue notes" do
- let!(:note) { create(:note_on_issue, note: "+1 from me") }
-
- it "should not be votable" do
- expect(note).to be_votable
- end
- end
-
- describe "Merge request notes" do
- let!(:note) { create(:note_on_merge_request, note: "+1 from me") }
-
- it "should be votable" do
- expect(note).to be_votable
- end
- end
-
- describe "Merge request diff line notes" do
- let!(:note) { create(:note_on_merge_request_diff, note: "+1 from me") }
-
- it "should not be votable" do
- expect(note).not_to be_votable
- end
- end
-
- describe '#create_status_change_note' do
- let(:project) { create(:project) }
- let(:thing) { create(:issue, project: project) }
- let(:author) { create(:user) }
- let(:status) { 'new_status' }
-
- subject { Note.create_status_change_note(thing, project, author, status, nil) }
-
- it 'creates and saves a Note' do
- is_expected.to be_a Note
- expect(subject.id).not_to be_nil
- end
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(thing) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(thing.project) }
- end
-
- describe '#author' do
- subject { super().author }
- it { is_expected.to eq(author) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("Status changed to #{status}") }
- end
-
- it 'appends a back-reference if a closing mentionable is supplied' do
- commit = double('commit', gfm_reference: 'commit 123456')
- n = Note.create_status_change_note(thing, project, author, status, commit)
-
- expect(n.note).to eq("Status changed to #{status} by commit 123456")
- end
- end
-
- describe '#create_assignee_change_note' do
- let(:project) { create(:project) }
- let(:thing) { create(:issue, project: project) }
- let(:author) { create(:user) }
- let(:assignee) { create(:user, username: "assigned_user") }
-
- subject { Note.create_assignee_change_note(thing, project, author, assignee) }
-
- context 'creates and saves a Note' do
- it { is_expected.to be_a Note }
-
- describe '#id' do
- subject { super().id }
- it { is_expected.not_to be_nil }
- end
- end
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(thing) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(thing.project) }
- end
-
- describe '#author' do
- subject { super().author }
- it { is_expected.to eq(author) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq('Reassigned to @assigned_user') }
- end
-
- context 'assignee is removed' do
- let(:assignee) { nil }
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq('Assignee removed') }
- end
- end
- end
-
- describe '#create_labels_change_note' do
- let(:project) { create(:project) }
- let(:thing) { create(:issue, project: project) }
- let(:author) { create(:user) }
- let(:label1) { create(:label) }
- let(:label2) { create(:label) }
- let(:added_labels) { [label1, label2] }
- let(:removed_labels) { [] }
-
- subject { Note.create_labels_change_note(thing, project, author, added_labels, removed_labels) }
-
- context 'creates and saves a Note' do
- it { is_expected.to be_a Note }
-
- describe '#id' do
- subject { super().id }
- it { is_expected.not_to be_nil }
- end
- end
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(thing) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(thing.project) }
- end
-
- describe '#author' do
- subject { super().author }
- it { is_expected.to eq(author) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("Added ~#{label1.id} ~#{label2.id} labels") }
- end
-
- context 'label is removed' do
- let(:added_labels) { [label1] }
- let(:removed_labels) { [label2] }
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("Added ~#{label1.id} and removed ~#{label2.id} labels") }
- end
- end
- end
-
- describe '#create_milestone_change_note' do
- let(:project) { create(:project) }
- let(:thing) { create(:issue, project: project) }
- let(:milestone) { create(:milestone, project: project, title: "first_milestone") }
- let(:author) { create(:user) }
-
- subject { Note.create_milestone_change_note(thing, project, author, milestone) }
-
- context 'creates and saves a Note' do
- it { is_expected.to be_a Note }
-
- describe '#id' do
- subject { super().id }
- it { is_expected.not_to be_nil }
- end
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(thing.project) }
- end
-
- describe '#author' do
- subject { super().author }
- it { is_expected.to eq(author) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("Milestone changed to first_milestone") }
- end
- end
-
- describe '#create_cross_reference_note' do
- let(:project) { create(:project) }
- let(:author) { create(:user) }
- let(:issue) { create(:issue, project: project) }
- let(:mergereq) { create(:merge_request, :simple, target_project: project, source_project: project) }
- let(:commit) { project.repository.commit }
-
- # Test all of {issue, merge request, commit} in both the referenced and referencing
- # roles, to ensure that the correct information can be inferred from any argument.
-
- context 'issue from a merge request' do
- subject { Note.create_cross_reference_note(issue, mergereq, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(issue) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(issue.project) }
- end
-
- describe '#author' do
- subject { super().author }
- it { is_expected.to eq(author) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in merge request !#{mergereq.iid}") }
- end
- end
-
- context 'issue from a commit' do
- subject { Note.create_cross_reference_note(issue, commit, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(issue) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in commit #{commit.sha}") }
- end
- end
-
- context 'merge request from an issue' do
- subject { Note.create_cross_reference_note(mergereq, issue, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(mergereq) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(mergereq.project) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in issue ##{issue.iid}") }
- end
- end
-
- context 'commit from a merge request' do
- subject { Note.create_cross_reference_note(commit, mergereq, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable' do
- subject { super().noteable }
- it { is_expected.to eq(commit) }
- end
-
- describe '#project' do
- subject { super().project }
- it { is_expected.to eq(project) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in merge request !#{mergereq.iid}") }
- end
- end
-
- context 'commit contained in a merge request' do
- subject { Note.create_cross_reference_note(mergereq.commits.first, mergereq, author, project) }
-
- it { is_expected.to be_nil }
- end
-
- context 'commit from issue' do
- subject { Note.create_cross_reference_note(commit, issue, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable_type' do
- subject { super().noteable_type }
- it { is_expected.to eq("Commit") }
- end
-
- describe '#noteable_id' do
- subject { super().noteable_id }
- it { is_expected.to be_nil }
- end
-
- describe '#commit_id' do
- subject { super().commit_id }
- it { is_expected.to eq(commit.id) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in issue ##{issue.iid}") }
- end
- end
-
- context 'commit from commit' do
- let(:parent_commit) { commit.parents.first }
- subject { Note.create_cross_reference_note(commit, parent_commit, author, project) }
-
- it { is_expected.to be_valid }
-
- describe '#noteable_type' do
- subject { super().noteable_type }
- it { is_expected.to eq("Commit") }
- end
-
- describe '#noteable_id' do
- subject { super().noteable_id }
- it { is_expected.to be_nil }
- end
-
- describe '#commit_id' do
- subject { super().commit_id }
- it { is_expected.to eq(commit.id) }
- end
-
- describe '#note' do
- subject { super().note }
- it { is_expected.to eq("mentioned in commit #{parent_commit.id}") }
- end
- end
- end
-
- describe '#cross_reference_exists?' do
- let(:project) { create :project }
- let(:author) { create :user }
- let(:issue) { create :issue }
- let(:commit0) { project.repository.commit }
- let(:commit1) { project.repository.commit('HEAD~2') }
-
- before do
- Note.create_cross_reference_note(issue, commit0, author, project)
- end
-
- it 'detects if a mentionable has already been mentioned' do
- expect(Note.cross_reference_exists?(issue, commit0)).to be_truthy
- end
-
- it 'detects if a mentionable has not already been mentioned' do
- expect(Note.cross_reference_exists?(issue, commit1)).to be_falsey
- end
-
- context 'commit on commit' do
- before do
- Note.create_cross_reference_note(commit0, commit1, author, project)
- end
-
- it { expect(Note.cross_reference_exists?(commit0, commit1)).to be_truthy }
- it { expect(Note.cross_reference_exists?(commit1, commit0)).to be_falsey }
- end
-
- context 'legacy note with Markdown emphasis' do
- let(:issue2) { create :issue, project: project }
- let!(:note) do
- create :note, system: true, noteable_id: issue2.id,
- noteable_type: "Issue", note: "_mentioned in issue " \
- "#{issue.project.path_with_namespace}##{issue.iid}_"
- end
-
- it 'detects if a mentionable with emphasis has been mentioned' do
- expect(Note.cross_reference_exists?(issue2, issue)).to be_truthy
- end
- end
- end
-
- describe '#cross_references_with_underscores?' do
- let(:project) { create :project, path: "first_project" }
- let(:second_project) { create :project, path: "second_project" }
-
- let(:author) { create :user }
- let(:issue0) { create :issue, project: project }
- let(:issue1) { create :issue, project: second_project }
- let!(:note) { Note.create_cross_reference_note(issue0, issue1, author, project) }
-
- it 'detects if a mentionable has already been mentioned' do
- expect(Note.cross_reference_exists?(issue0, issue1)).to be_truthy
- end
-
- it 'detects if a mentionable has not already been mentioned' do
- expect(Note.cross_reference_exists?(issue1, issue0)).to be_falsey
- end
-
- it 'detects that text has underscores' do
- expect(note.note).to eq("mentioned in issue #{second_project.path_with_namespace}##{issue1.iid}")
- end
- end
-
- describe '#system?' do
- let(:project) { create(:project) }
- let(:issue) { create(:issue, project: project) }
- let(:other) { create(:issue, project: project) }
- let(:author) { create(:user) }
- let(:assignee) { create(:user) }
- let(:label) { create(:label) }
- let(:milestone) { create(:milestone) }
-
- it 'should recognize user-supplied notes as non-system' do
- @note = create(:note_on_issue)
- expect(@note).not_to be_system
- end
-
- it 'should identify status-change notes as system notes' do
- @note = Note.create_status_change_note(issue, project, author, 'closed', nil)
- expect(@note).to be_system
- end
-
- it 'should identify cross-reference notes as system notes' do
- @note = Note.create_cross_reference_note(issue, other, author, project)
- expect(@note).to be_system
- end
-
- it 'should identify assignee-change notes as system notes' do
- @note = Note.create_assignee_change_note(issue, project, author, assignee)
- expect(@note).to be_system
- end
-
- it 'should identify label-change notes as system notes' do
- @note = Note.create_labels_change_note(issue, project, author, [label], [])
- expect(@note).to be_system
- end
-
- it 'should identify milestone-change notes as system notes' do
- @note = Note.create_milestone_change_note(issue, project, author, milestone)
- expect(@note).to be_system
- end
- end
-
- describe :authorization do
- before do
- @p1 = create(:project)
- @p2 = create(:project)
- @u1 = create(:user)
- @u2 = create(:user)
- @u3 = create(:user)
- @abilities = Six.new
- @abilities << Ability
- end
-
- describe :read do
- before do
- @p1.project_members.create(user: @u2, access_level: ProjectMember::GUEST)
- @p2.project_members.create(user: @u3, access_level: ProjectMember::GUEST)
- end
-
- it { expect(@abilities.allowed?(@u1, :read_note, @p1)).to be_falsey }
- it { expect(@abilities.allowed?(@u2, :read_note, @p1)).to be_truthy }
- it { expect(@abilities.allowed?(@u3, :read_note, @p1)).to be_falsey }
- end
-
- describe :write do
- before do
- @p1.project_members.create(user: @u2, access_level: ProjectMember::DEVELOPER)
- @p2.project_members.create(user: @u3, access_level: ProjectMember::DEVELOPER)
- end
-
- it { expect(@abilities.allowed?(@u1, :write_note, @p1)).to be_falsey }
- it { expect(@abilities.allowed?(@u2, :write_note, @p1)).to be_truthy }
- it { expect(@abilities.allowed?(@u3, :write_note, @p1)).to be_falsey }
- end
-
- describe :admin do
- before do
- @p1.project_members.create(user: @u1, access_level: ProjectMember::REPORTER)
- @p1.project_members.create(user: @u2, access_level: ProjectMember::MASTER)
- @p2.project_members.create(user: @u3, access_level: ProjectMember::MASTER)
- end
-
- it { expect(@abilities.allowed?(@u1, :admin_note, @p1)).to be_falsey }
- it { expect(@abilities.allowed?(@u2, :admin_note, @p1)).to be_truthy }
- it { expect(@abilities.allowed?(@u3, :admin_note, @p1)).to be_falsey }
- end
- end
-
- it_behaves_like 'an editable mentionable' do
- let(:issue) { create :issue, project: project }
- let(:subject) { create :note, noteable: issue, project: project }
- let(:backref_text) { issue.gfm_reference }
- let(:set_mentionable_text) { ->(txt) { subject.note = txt } }
- end
-end
diff --git a/spec/models/project_security_spec.rb b/spec/models/project_security_spec.rb
deleted file mode 100644
index 1ee1900354378f7f4141a257043946ce4e02305a..0000000000000000000000000000000000000000
--- a/spec/models/project_security_spec.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-require 'spec_helper'
-
-describe Project do
- describe :authorization do
- before do
- @p1 = create(:project)
-
- @u1 = create(:user)
- @u2 = create(:user)
- @u3 = create(:user)
- @u4 = @p1.owner
-
- @abilities = Six.new
- @abilities << Ability
- end
-
- let(:guest_actions) { Ability.project_guest_rules }
- let(:report_actions) { Ability.project_report_rules }
- let(:dev_actions) { Ability.project_dev_rules }
- let(:master_actions) { Ability.project_master_rules }
- let(:admin_actions) { Ability.project_admin_rules }
-
- describe "Non member rules" do
- it "should deny for non-project users any actions" do
- admin_actions.each do |action|
- expect(@abilities.allowed?(@u1, action, @p1)).to be_falsey
- end
- end
- end
-
- describe "Guest Rules" do
- before do
- @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::GUEST)
- end
-
- it "should allow for project user any guest actions" do
- guest_actions.each do |action|
- expect(@abilities.allowed?(@u2, action, @p1)).to be_truthy
- end
- end
- end
-
- describe "Report Rules" do
- before do
- @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::REPORTER)
- end
-
- it "should allow for project user any report actions" do
- report_actions.each do |action|
- expect(@abilities.allowed?(@u2, action, @p1)).to be_truthy
- end
- end
- end
-
- describe "Developer Rules" do
- before do
- @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::REPORTER)
- @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::DEVELOPER)
- end
-
- it "should deny for developer master-specific actions" do
- [dev_actions - report_actions].each do |action|
- expect(@abilities.allowed?(@u2, action, @p1)).to be_falsey
- end
- end
-
- it "should allow for project user any dev actions" do
- dev_actions.each do |action|
- expect(@abilities.allowed?(@u3, action, @p1)).to be_truthy
- end
- end
- end
-
- describe "Master Rules" do
- before do
- @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::DEVELOPER)
- @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::MASTER)
- end
-
- it "should deny for developer master-specific actions" do
- [master_actions - dev_actions].each do |action|
- expect(@abilities.allowed?(@u2, action, @p1)).to be_falsey
- end
- end
-
- it "should allow for project user any master actions" do
- master_actions.each do |action|
- expect(@abilities.allowed?(@u3, action, @p1)).to be_truthy
- end
- end
- end
-
- describe "Admin Rules" do
- before do
- @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::DEVELOPER)
- @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::MASTER)
- end
-
- it "should deny for masters admin-specific actions" do
- [admin_actions - master_actions].each do |action|
- expect(@abilities.allowed?(@u2, action, @p1)).to be_falsey
- end
- end
-
- it "should allow for project owner any admin actions" do
- admin_actions.each do |action|
- expect(@abilities.allowed?(@u4, action, @p1)).to be_truthy
- end
- end
- end
- end
-end
-# == Schema Information
-#
-# Table name: projects
-#
-# id :integer not null, primary key
-# name :string(255)
-# path :string(255)
-# description :text
-# created_at :datetime
-# updated_at :datetime
-# private_flag :boolean default(TRUE), not null
-# code :string(255)
-#
-
diff --git a/spec/models/project_services/asana_service_spec.rb b/spec/models/project_services/asana_service_spec.rb
deleted file mode 100644
index 13c8d54a2af522664582b7ce487b50a9a84e5235..0000000000000000000000000000000000000000
--- a/spec/models/project_services/asana_service_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe AsanaService, models: true do
- describe 'Associations' do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe 'Validations' do
- context 'active' do
- before do
- subject.active = true
- end
-
- it { is_expected.to validate_presence_of :api_key }
- end
- end
-
- describe 'Execute' do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
-
- before do
- @asana = AsanaService.new
- @asana.stub(
- project: project,
- project_id: project.id,
- service_hook: true,
- api_key: 'verySecret',
- restrict_to_branch: 'master'
- )
- end
-
- it 'should call Asana service to created a story' do
- expect(Asana::Task).to receive(:find).with('123456').once
-
- @asana.check_commit('related to #123456', 'pushed')
- end
-
- it 'should call Asana service to created a story and close a task' do
- expect(Asana::Task).to receive(:find).with('456789').twice
-
- @asana.check_commit('fix #456789', 'pushed')
- end
- end
-end
diff --git a/spec/models/project_services/assembla_service_spec.rb b/spec/models/project_services/assembla_service_spec.rb
deleted file mode 100644
index 91730da1eecdbdf7d6ec85e8dca5d8a14eb649b9..0000000000000000000000000000000000000000
--- a/spec/models/project_services/assembla_service_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe AssemblaService, models: true do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Execute" do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
-
- before do
- @assembla_service = AssemblaService.new
- @assembla_service.stub(
- project_id: project.id,
- project: project,
- service_hook: true,
- token: 'verySecret',
- subdomain: 'project_name'
- )
- @sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
- @api_url = 'https://atlas.assembla.com/spaces/project_name/github_tool?secret_key=verySecret'
- WebMock.stub_request(:post, @api_url)
- end
-
- it "should call Assembla API" do
- @assembla_service.execute(@sample_data)
- expect(WebMock).to have_requested(:post, @api_url).with(
- body: /#{@sample_data[:before]}.*#{@sample_data[:after]}.*#{project.path}/
- ).once
- end
- end
-end
diff --git a/spec/models/project_services/buildkite_service_spec.rb b/spec/models/project_services/buildkite_service_spec.rb
deleted file mode 100644
index e987241f3cabadf3c2f7aeb6975159a0a5ed3a0b..0000000000000000000000000000000000000000
--- a/spec/models/project_services/buildkite_service_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe BuildkiteService do
- describe 'Associations' do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe 'commits methods' do
- before do
- @project = Project.new
- @project.stub(
- default_branch: 'default-brancho'
- )
-
- @service = BuildkiteService.new
- @service.stub(
- project: @project,
- service_hook: true,
- project_url: 'https://buildkite.com/account-name/example-project',
- token: 'secret-sauce-webhook-token:secret-sauce-status-token'
- )
- end
-
- describe :webhook_url do
- it 'returns the webhook url' do
- expect(@service.webhook_url).to eq(
- 'https://webhook.buildkite.com/deliver/secret-sauce-webhook-token'
- )
- end
- end
-
- describe :commit_status_path do
- it 'returns the correct status page' do
- expect(@service.commit_status_path('2ab7834c')).to eq(
- 'https://gitlab.buildkite.com/status/secret-sauce-status-token.json?commit=2ab7834c'
- )
- end
- end
-
- describe :build_page do
- it 'returns the correct build page' do
- expect(@service.build_page('2ab7834c', nil)).to eq(
- 'https://buildkite.com/account-name/example-project/builds?commit=2ab7834c'
- )
- end
- end
-
- describe :builds_page do
- it 'returns the correct path to the builds page' do
- expect(@service.builds_path).to eq(
- 'https://buildkite.com/account-name/example-project/builds?branch=default-brancho'
- )
- end
- end
-
- describe :status_img_path do
- it 'returns the correct path to the status image' do
- expect(@service.status_img_path).to eq('https://badge.buildkite.com/secret-sauce-status-token.svg')
- end
- end
- end
-end
diff --git a/spec/models/project_services/flowdock_service_spec.rb b/spec/models/project_services/flowdock_service_spec.rb
deleted file mode 100644
index 73f68301a34e309a8ff7b76b587875964c6005bb..0000000000000000000000000000000000000000
--- a/spec/models/project_services/flowdock_service_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe FlowdockService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Execute" do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
-
- before do
- @flowdock_service = FlowdockService.new
- @flowdock_service.stub(
- project_id: project.id,
- project: project,
- service_hook: true,
- token: 'verySecret'
- )
- @sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
- @api_url = 'https://api.flowdock.com/v1/git/verySecret'
- WebMock.stub_request(:post, @api_url)
- end
-
- it "should call FlowDock API" do
- @flowdock_service.execute(@sample_data)
- expect(WebMock).to have_requested(:post, @api_url).with(
- body: /#{@sample_data[:before]}.*#{@sample_data[:after]}.*#{project.path}/
- ).once
- end
- end
-end
diff --git a/spec/models/project_services/gemnasium_service_spec.rb b/spec/models/project_services/gemnasium_service_spec.rb
deleted file mode 100644
index d44064bbe6a14f839eb857b9fe9f495b3a3d788c..0000000000000000000000000000000000000000
--- a/spec/models/project_services/gemnasium_service_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe GemnasiumService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Execute" do
- let(:user) { create(:user) }
- let(:project) { create(:project) }
-
- before do
- @gemnasium_service = GemnasiumService.new
- @gemnasium_service.stub(
- project_id: project.id,
- project: project,
- service_hook: true,
- token: 'verySecret',
- api_key: 'GemnasiumUserApiKey'
- )
- @sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
- end
- it "should call Gemnasium service" do
- expect(Gemnasium::GitlabService).to receive(:execute).with(an_instance_of(Hash)).once
- @gemnasium_service.execute(@sample_data)
- end
- end
-end
diff --git a/spec/models/project_services/gitlab_ci_service_spec.rb b/spec/models/project_services/gitlab_ci_service_spec.rb
deleted file mode 100644
index 6a557d839caaeef9575c9d4ba19dced6591befbf..0000000000000000000000000000000000000000
--- a/spec/models/project_services/gitlab_ci_service_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe GitlabCiService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Mass assignment" do
- end
-
- describe 'commits methods' do
- before do
- @service = GitlabCiService.new
- @service.stub(
- service_hook: true,
- project_url: 'http://ci.gitlab.org/projects/2',
- token: 'verySecret'
- )
- end
-
- describe :commit_status_path do
- it { expect(@service.commit_status_path("2ab7834c", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c/status.json?token=verySecret")}
- end
-
- describe :build_page do
- it { expect(@service.build_page("2ab7834c", 'master')).to eq("http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c")}
- end
- end
-
- describe "Fork registration" do
- before do
- @old_project = create(:empty_project)
- @project = create(:empty_project)
- @user = create(:user)
-
- @service = GitlabCiService.new
- @service.stub(
- service_hook: true,
- project_url: 'http://ci.gitlab.org/projects/2',
- token: 'verySecret',
- project: @old_project
- )
- end
-
- it "performs http reuquest to ci" do
- stub_request(:post, "http://ci.gitlab.org/api/v1/forks")
- @service.fork_registration(@project, @user.private_token)
- end
- end
-end
diff --git a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb
deleted file mode 100644
index f94bef5c3659f4f7e2914af185032c211b58bdf0..0000000000000000000000000000000000000000
--- a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe GitlabIssueTrackerService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
-
- describe 'project and issue urls' do
- let(:project) { create(:project) }
-
- context 'with absolute urls' do
- before do
- GitlabIssueTrackerService.default_url_options[:script_name] = "/gitlab/root"
- @service = project.create_gitlab_issue_tracker_service(active: true)
- end
-
- after do
- @service.destroy!
- end
-
- it 'should give the correct path' do
- expect(@service.project_url).to eq("http://localhost/gitlab/root/#{project.path_with_namespace}/issues")
- expect(@service.new_issue_url).to eq("http://localhost/gitlab/root/#{project.path_with_namespace}/issues/new")
- expect(@service.issue_url(432)).to eq("http://localhost/gitlab/root/#{project.path_with_namespace}/issues/432")
- end
- end
-
- context 'with relative urls' do
- before do
- GitlabIssueTrackerService.default_url_options[:script_name] = "/gitlab/root"
- @service = project.create_gitlab_issue_tracker_service(active: true)
- end
-
- after do
- @service.destroy!
- end
-
- it 'should give the correct path' do
- expect(@service.project_path).to eq("/gitlab/root/#{project.path_with_namespace}/issues")
- expect(@service.new_issue_path).to eq("/gitlab/root/#{project.path_with_namespace}/issues/new")
- expect(@service.issue_path(432)).to eq("/gitlab/root/#{project.path_with_namespace}/issues/432")
- end
- end
- end
-end
diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb
deleted file mode 100644
index 8ab847e64323f06c127ba3ecf8949590d86caff4..0000000000000000000000000000000000000000
--- a/spec/models/project_services/hipchat_service_spec.rb
+++ /dev/null
@@ -1,217 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe HipchatService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Execute" do
- let(:hipchat) { HipchatService.new }
- let(:user) { create(:user, username: 'username') }
- let(:project) { create(:project, name: 'project') }
- let(:api_url) { 'https://hipchat.example.com/v2/room/123456/notification?auth_token=verySecret' }
- let(:project_name) { project.name_with_namespace.gsub(/\s/, '') }
-
- before(:each) do
- hipchat.stub(
- project_id: project.id,
- project: project,
- room: 123456,
- server: 'https://hipchat.example.com',
- token: 'verySecret'
- )
- WebMock.stub_request(:post, api_url)
- end
-
- context 'push events' do
- let(:push_sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
-
- it "should call Hipchat API for push events" do
- hipchat.execute(push_sample_data)
-
- expect(WebMock).to have_requested(:post, api_url).once
- end
-
- it "should create a push message" do
- message = hipchat.send(:create_push_message, push_sample_data)
-
- obj_attr = push_sample_data[:object_attributes]
- branch = push_sample_data[:ref].gsub('refs/heads/', '')
- expect(message).to include("#{user.name} pushed to branch " \
- "#{branch} of " \
- "#{project_name}")
- end
- end
-
- context 'tag_push events' do
- let(:push_sample_data) { Gitlab::PushDataBuilder.build(project, user, Gitlab::Git::BLANK_SHA, '1' * 40, 'refs/tags/test', []) }
-
- it "should call Hipchat API for tag push events" do
- hipchat.execute(push_sample_data)
-
- expect(WebMock).to have_requested(:post, api_url).once
- end
-
- it "should create a tag push message" do
- message = hipchat.send(:create_push_message, push_sample_data)
-
- obj_attr = push_sample_data[:object_attributes]
- expect(message).to eq("#{user.name} pushed new tag " \
- "test to " \
- "#{project_name}\n")
- end
- end
-
- context 'issue events' do
- let(:issue) { create(:issue, title: 'Awesome issue', description: 'please fix') }
- let(:issue_service) { Issues::CreateService.new(project, user) }
- let(:issues_sample_data) { issue_service.hook_data(issue, 'open') }
-
- it "should call Hipchat API for issue events" do
- hipchat.execute(issues_sample_data)
-
- expect(WebMock).to have_requested(:post, api_url).once
- end
-
- it "should create an issue message" do
- message = hipchat.send(:create_issue_message, issues_sample_data)
-
- obj_attr = issues_sample_data[:object_attributes]
- expect(message).to eq("#{user.name} opened " \
- "issue ##{obj_attr["iid"]} in " \
- "#{project_name}: " \
- "Awesome issue" \
- "please fix
")
- end
- end
-
- context 'merge request events' do
- let(:merge_request) { create(:merge_request, description: 'please fix', title: 'Awesome merge request', target_project: project, source_project: project) }
- let(:merge_service) { MergeRequests::CreateService.new(project, user) }
- let(:merge_sample_data) { merge_service.hook_data(merge_request, 'open') }
-
- it "should call Hipchat API for merge requests events" do
- hipchat.execute(merge_sample_data)
-
- expect(WebMock).to have_requested(:post, api_url).once
- end
-
- it "should create a merge request message" do
- message = hipchat.send(:create_merge_request_message,
- merge_sample_data)
-
- obj_attr = merge_sample_data[:object_attributes]
- expect(message).to eq("#{user.name} opened " \
- "merge request ##{obj_attr["iid"]} in " \
- "#{project_name}: " \
- "Awesome merge request" \
- "please fix
")
- end
- end
-
- context "Note events" do
- let(:user) { create(:user) }
- let(:project) { create(:project, creator_id: user.id) }
- let(:issue) { create(:issue, project: project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:snippet) { create(:project_snippet, project: project) }
- let(:commit_note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'a comment on a commit') }
- let(:merge_request_note) { create(:note_on_merge_request, noteable_id: merge_request.id, note: "merge request note") }
- let(:issue_note) { create(:note_on_issue, noteable_id: issue.id, note: "issue note")}
- let(:snippet_note) { create(:note_on_project_snippet, noteable_id: snippet.id, note: "snippet note") }
-
- it "should call Hipchat API for commit comment events" do
- data = Gitlab::NoteDataBuilder.build(commit_note, user)
- hipchat.execute(data)
-
- expect(WebMock).to have_requested(:post, api_url).once
-
- message = hipchat.send(:create_message, data)
-
- obj_attr = data[:object_attributes]
- commit_id = Commit.truncate_sha(data[:commit][:id])
- title = hipchat.send(:format_title, data[:commit][:message])
-
- expect(message).to eq("#{user.name} commented on " \
- "commit #{commit_id} in " \
- "#{project_name}: " \
- "#{title}" \
- "a comment on a commit
")
- end
-
- it "should call Hipchat API for merge request comment events" do
- data = Gitlab::NoteDataBuilder.build(merge_request_note, user)
- hipchat.execute(data)
-
- expect(WebMock).to have_requested(:post, api_url).once
-
- message = hipchat.send(:create_message, data)
-
- obj_attr = data[:object_attributes]
- merge_id = data[:merge_request]['iid']
- title = data[:merge_request]['title']
-
- expect(message).to eq("#{user.name} commented on " \
- "merge request ##{merge_id} in " \
- "#{project_name}: " \
- "#{title}" \
- "merge request note
")
- end
-
- it "should call Hipchat API for issue comment events" do
- data = Gitlab::NoteDataBuilder.build(issue_note, user)
- hipchat.execute(data)
-
- message = hipchat.send(:create_message, data)
-
- obj_attr = data[:object_attributes]
- issue_id = data[:issue]['iid']
- title = data[:issue]['title']
-
- expect(message).to eq("#{user.name} commented on " \
- "issue ##{issue_id} in " \
- "#{project_name}: " \
- "#{title}" \
- "issue note
")
- end
-
- it "should call Hipchat API for snippet comment events" do
- data = Gitlab::NoteDataBuilder.build(snippet_note, user)
- hipchat.execute(data)
-
- expect(WebMock).to have_requested(:post, api_url).once
-
- message = hipchat.send(:create_message, data)
-
- obj_attr = data[:object_attributes]
- snippet_id = data[:snippet]['id']
- title = data[:snippet]['title']
-
- expect(message).to eq("#{user.name} commented on " \
- "snippet ##{snippet_id} in " \
- "#{project_name}: " \
- "#{title}" \
- "snippet note
")
- end
- end
- end
-end
diff --git a/spec/models/project_services/irker_service_spec.rb b/spec/models/project_services/irker_service_spec.rb
deleted file mode 100644
index d55399bc360102ea6037502ce6adba53013dea4e..0000000000000000000000000000000000000000
--- a/spec/models/project_services/irker_service_spec.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-require 'socket'
-require 'json'
-
-describe IrkerService do
- describe 'Associations' do
- it { should belong_to :project }
- it { should have_one :service_hook }
- end
-
- describe 'Validations' do
- before do
- subject.active = true
- subject.properties['recipients'] = _recipients
- end
-
- context 'active' do
- let(:_recipients) { nil }
- it { should validate_presence_of :recipients }
- end
-
- context 'too many recipients' do
- let(:_recipients) { 'a b c d' }
- it 'should add an error if there is too many recipients' do
- subject.send :check_recipients_count
- subject.errors.should_not be_blank
- end
- end
-
- context '3 recipients' do
- let(:_recipients) { 'a b c' }
- it 'should not add an error if there is 3 recipients' do
- subject.send :check_recipients_count
- subject.errors.should be_blank
- end
- end
- end
-
- describe 'Execute' do
- let(:irker) { IrkerService.new }
- let(:user) { create(:user) }
- let(:project) { create(:project) }
- let(:sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
-
- let(:recipients) { '#commits' }
- let(:colorize_messages) { '1' }
-
- before do
- irker.stub(
- active: true,
- project: project,
- project_id: project.id,
- service_hook: true,
- properties: {
- 'recipients' => recipients,
- 'colorize_messages' => colorize_messages
- }
- )
- irker.settings = {
- server_ip: 'localhost',
- server_port: 6659,
- max_channels: 3,
- default_irc_uri: 'irc://chat.freenode.net/'
- }
- irker.valid?
- @irker_server = TCPServer.new 'localhost', 6659
- end
-
- after do
- @irker_server.close
- end
-
- it 'should send valid JSON messages to an Irker listener' do
- irker.execute(sample_data)
-
- conn = @irker_server.accept
- conn.readlines.each do |line|
- msg = JSON.load(line.chomp("\n"))
- msg.keys.should match_array(['to', 'privmsg'])
- if msg['to'].is_a?(String)
- msg['to'].should == 'irc://chat.freenode.net/#commits'
- else
- msg['to'].should match_array(['irc://chat.freenode.net/#commits'])
- end
- end
- conn.close
- end
- end
-end
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
deleted file mode 100644
index 355911e637771a8227faac071953896ec239e5a5..0000000000000000000000000000000000000000
--- a/spec/models/project_services/jira_service_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe JiraService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Validations" do
- context "active" do
- before do
- subject.active = true
- end
-
- it { is_expected.to validate_presence_of :project_url }
- it { is_expected.to validate_presence_of :issues_url }
- it { is_expected.to validate_presence_of :new_issue_url }
- end
- end
-
- describe 'description and title' do
- let(:project) { create(:project) }
-
- context 'when it is not set' do
- before do
- @service = project.create_jira_service(active: true)
- end
-
- after do
- @service.destroy!
- end
-
- it 'should be initialized' do
- expect(@service.title).to eq('JIRA')
- expect(@service.description).to eq("Jira issue tracker")
- end
- end
-
- context 'when it is set' do
- before do
- properties = { 'title' => 'Jira One', 'description' => 'Jira One issue tracker' }
- @service = project.create_jira_service(active: true, properties: properties)
- end
-
- after do
- @service.destroy!
- end
-
- it "should be correct" do
- expect(@service.title).to eq('Jira One')
- expect(@service.description).to eq('Jira One issue tracker')
- end
- end
- end
-
- describe 'project and issue urls' do
- let(:project) { create(:project) }
-
- context 'when gitlab.yml was initialized' do
- before do
- settings = { "jira" => {
- "title" => "Jira",
- "project_url" => "http://jira.sample/projects/project_a",
- "issues_url" => "http://jira.sample/issues/:id",
- "new_issue_url" => "http://jira.sample/projects/project_a/issues/new"
- }
- }
- allow(Gitlab.config).to receive(:issues_tracker).and_return(settings)
- @service = project.create_jira_service(active: true)
- end
-
- after do
- @service.destroy!
- end
-
- it 'should be prepopulated with the settings' do
- expect(@service.properties[:project_url]).to eq('http://jira.sample/projects/project_a')
- expect(@service.properties[:issues_url]).to eq("http://jira.sample/issues/:id")
- expect(@service.properties[:new_issue_url]).to eq("http://jira.sample/projects/project_a/issues/new")
- end
- end
- end
-end
diff --git a/spec/models/project_services/pushover_service_spec.rb b/spec/models/project_services/pushover_service_spec.rb
deleted file mode 100644
index 5a18fd09bfc95caf51c590106bb2ee9effbe647c..0000000000000000000000000000000000000000
--- a/spec/models/project_services/pushover_service_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe PushoverService do
- describe 'Associations' do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe 'Validations' do
- context 'active' do
- before do
- subject.active = true
- end
-
- it { is_expected.to validate_presence_of :api_key }
- it { is_expected.to validate_presence_of :user_key }
- it { is_expected.to validate_presence_of :priority }
- end
- end
-
- describe 'Execute' do
- let(:pushover) { PushoverService.new }
- let(:user) { create(:user) }
- let(:project) { create(:project) }
- let(:sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
-
- let(:api_key) { 'verySecret' }
- let(:user_key) { 'verySecret' }
- let(:device) { 'myDevice' }
- let(:priority) { 0 }
- let(:sound) { 'bike' }
- let(:api_url) { 'https://api.pushover.net/1/messages.json' }
-
- before do
- pushover.stub(
- project: project,
- project_id: project.id,
- service_hook: true,
- api_key: api_key,
- user_key: user_key,
- device: device,
- priority: priority,
- sound: sound
- )
-
- WebMock.stub_request(:post, api_url)
- end
-
- it 'should call Pushover API' do
- pushover.execute(sample_data)
-
- expect(WebMock).to have_requested(:post, api_url).once
- end
- end
-end
diff --git a/spec/models/project_services/slack_service/issue_message_spec.rb b/spec/models/project_services/slack_service/issue_message_spec.rb
deleted file mode 100644
index 8bca1fef44c50f1c281ad2c405fee18e8db6b2cb..0000000000000000000000000000000000000000
--- a/spec/models/project_services/slack_service/issue_message_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'spec_helper'
-
-describe SlackService::IssueMessage do
- subject { SlackService::IssueMessage.new(args) }
-
- let(:args) {
- {
- user: {
- name: 'Test User',
- username: 'Test User'
- },
- project_name: 'project_name',
- project_url: 'somewhere.com',
-
- object_attributes: {
- title: 'Issue title',
- id: 10,
- iid: 100,
- assignee_id: 1,
- url: 'url',
- action: 'open',
- state: 'opened',
- description: 'issue description'
- }
- }
- }
-
- let(:color) { '#345' }
-
- context 'open' do
- it 'returns a message regarding opening of issues' do
- expect(subject.pretext).to eq(
- 'Test User opened in : '\
- '*Issue title*')
- expect(subject.attachments).to eq([
- {
- text: "issue description",
- color: color,
- }
- ])
- end
- end
-
- context 'close' do
- before do
- args[:object_attributes][:action] = 'close'
- args[:object_attributes][:state] = 'closed'
- end
- it 'returns a message regarding closing of issues' do
- expect(subject.pretext). to eq(
- 'Test User closed in : '\
- '*Issue title*')
- expect(subject.attachments).to be_empty
- end
- end
-end
diff --git a/spec/models/project_services/slack_service/merge_message_spec.rb b/spec/models/project_services/slack_service/merge_message_spec.rb
deleted file mode 100644
index aeb408aa766d4b164f7a6daaad07c83f25f5664e..0000000000000000000000000000000000000000
--- a/spec/models/project_services/slack_service/merge_message_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'spec_helper'
-
-describe SlackService::MergeMessage do
- subject { SlackService::MergeMessage.new(args) }
-
- let(:args) {
- {
- user: {
- name: 'Test User',
- username: 'Test User'
- },
- project_name: 'project_name',
- project_url: 'somewhere.com',
-
- object_attributes: {
- title: "Issue title\nSecond line",
- id: 10,
- iid: 100,
- assignee_id: 1,
- url: 'url',
- state: 'opened',
- description: 'issue description',
- source_branch: 'source_branch',
- target_branch: 'target_branch',
- }
- }
- }
-
- let(:color) { '#345' }
-
- context 'open' do
- it 'returns a message regarding opening of merge requests' do
- expect(subject.pretext).to eq(
- 'Test User opened '\
- 'in : *Issue title*')
- expect(subject.attachments).to be_empty
- end
- end
-
- context 'close' do
- before do
- args[:object_attributes][:state] = 'closed'
- end
- it 'returns a message regarding closing of merge requests' do
- expect(subject.pretext).to eq(
- 'Test User closed '\
- 'in : *Issue title*')
- expect(subject.attachments).to be_empty
- end
- end
-end
diff --git a/spec/models/project_services/slack_service/note_message_spec.rb b/spec/models/project_services/slack_service/note_message_spec.rb
deleted file mode 100644
index 21fb575480b8fd091bf0a55ac97b4cc91895acfd..0000000000000000000000000000000000000000
--- a/spec/models/project_services/slack_service/note_message_spec.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'spec_helper'
-
-describe SlackService::NoteMessage do
- let(:color) { '#345' }
-
- before do
- @args = {
- user: {
- name: 'Test User',
- username: 'username',
- avatar_url: 'http://fakeavatar'
- },
- project_name: 'project_name',
- project_url: 'somewhere.com',
- repository: {
- name: 'project_name',
- url: 'somewhere.com',
- },
- object_attributes: {
- id: 10,
- note: 'comment on a commit',
- url: 'url',
- noteable_type: 'Commit'
- }
- }
- end
-
- context 'commit notes' do
- before do
- @args[:object_attributes][:note] = 'comment on a commit'
- @args[:object_attributes][:noteable_type] = 'Commit'
- @args[:commit] = {
- id: '5f163b2b95e6f53cbd428f5f0b103702a52b9a23',
- message: "Added a commit message\ndetails\n123\n"
- }
- end
-
- it 'returns a message regarding notes on commits' do
- message = SlackService::NoteMessage.new(@args)
- expect(message.pretext).to eq("Test User commented on " \
- " in : " \
- "*Added a commit message*")
- expected_attachments = [
- {
- text: "comment on a commit",
- color: color,
- }
- ]
- expect(message.attachments).to eq(expected_attachments)
- end
- end
-
- context 'merge request notes' do
- before do
- @args[:object_attributes][:note] = 'comment on a merge request'
- @args[:object_attributes][:noteable_type] = 'MergeRequest'
- @args[:merge_request] = {
- id: 1,
- iid: 30,
- title: "merge request title\ndetails\n"
- }
- end
- it 'returns a message regarding notes on a merge request' do
- message = SlackService::NoteMessage.new(@args)
- expect(message.pretext).to eq("Test User commented on " \
- " in : " \
- "*merge request title*")
- expected_attachments = [
- {
- text: "comment on a merge request",
- color: color,
- }
- ]
- expect(message.attachments).to eq(expected_attachments)
- end
- end
-
- context 'issue notes' do
- before do
- @args[:object_attributes][:note] = 'comment on an issue'
- @args[:object_attributes][:noteable_type] = 'Issue'
- @args[:issue] = {
- id: 1,
- iid: 20,
- title: "issue title\ndetails\n"
- }
- end
-
- it 'returns a message regarding notes on an issue' do
- message = SlackService::NoteMessage.new(@args)
- expect(message.pretext).to eq(
- "Test User commented on " \
- " in : " \
- "*issue title*")
- expected_attachments = [
- {
- text: "comment on an issue",
- color: color,
- }
- ]
- expect(message.attachments).to eq(expected_attachments)
- end
- end
-
- context 'project snippet notes' do
- before do
- @args[:object_attributes][:note] = 'comment on a snippet'
- @args[:object_attributes][:noteable_type] = 'Snippet'
- @args[:snippet] = {
- id: 5,
- title: "snippet title\ndetails\n"
- }
- end
-
- it 'returns a message regarding notes on a project snippet' do
- message = SlackService::NoteMessage.new(@args)
- expect(message.pretext).to eq("Test User commented on " \
- " in : " \
- "*snippet title*")
- expected_attachments = [
- {
- text: "comment on a snippet",
- color: color,
- }
- ]
- expect(message.attachments).to eq(expected_attachments)
- end
- end
-end
diff --git a/spec/models/project_services/slack_service/push_message_spec.rb b/spec/models/project_services/slack_service/push_message_spec.rb
deleted file mode 100644
index 10963481a1248dfee077ece3c86a6b4edb39f665..0000000000000000000000000000000000000000
--- a/spec/models/project_services/slack_service/push_message_spec.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require 'spec_helper'
-
-describe SlackService::PushMessage do
- subject { SlackService::PushMessage.new(args) }
-
- let(:args) {
- {
- after: 'after',
- before: 'before',
- project_name: 'project_name',
- ref: 'refs/heads/master',
- user_name: 'user_name',
- project_url: 'url'
- }
- }
-
- let(:color) { '#345' }
-
- context 'push' do
- before do
- args[:commits] = [
- { message: 'message1', url: 'url1', id: 'abcdefghijkl', author: { name: 'author1' } },
- { message: 'message2', url: 'url2', id: '123456789012', author: { name: 'author2' } },
- ]
- end
-
- it 'returns a message regarding pushes' do
- expect(subject.pretext).to eq(
- 'user_name pushed to branch of '\
- ' ()'
- )
- expect(subject.attachments).to eq([
- {
- text: ": message1 - author1\n"\
- ": message2 - author2",
- color: color,
- }
- ])
- end
- end
-
- context 'tag push' do
- let(:args) {
- {
- after: 'after',
- before: Gitlab::Git::BLANK_SHA,
- project_name: 'project_name',
- ref: 'refs/tags/new_tag',
- user_name: 'user_name',
- project_url: 'url'
- }
- }
-
- it 'returns a message regarding pushes' do
- expect(subject.pretext).to eq('user_name pushed new tag ' \
- ' to ' \
- '')
- expect(subject.attachments).to be_empty
- end
- end
-
- context 'new branch' do
- before do
- args[:before] = Gitlab::Git::BLANK_SHA
- end
-
- it 'returns a message regarding a new branch' do
- expect(subject.pretext).to eq(
- 'user_name pushed new branch to '\
- ''
- )
- expect(subject.attachments).to be_empty
- end
- end
-
- context 'removed branch' do
- before do
- args[:after] = Gitlab::Git::BLANK_SHA
- end
-
- it 'returns a message regarding a removed branch' do
- expect(subject.pretext).to eq(
- 'user_name removed branch master from '
- )
- expect(subject.attachments).to be_empty
- end
- end
-end
diff --git a/spec/models/project_services/slack_service_spec.rb b/spec/models/project_services/slack_service_spec.rb
deleted file mode 100644
index c36506644b30c74508a91abaf5e44357a7d9ad7c..0000000000000000000000000000000000000000
--- a/spec/models/project_services/slack_service_spec.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe SlackService do
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Validations" do
- context "active" do
- before do
- subject.active = true
- end
-
- it { is_expected.to validate_presence_of :webhook }
- end
- end
-
- describe "Execute" do
- let(:slack) { SlackService.new }
- let(:user) { create(:user) }
- let(:project) { create(:project) }
- let(:push_sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
- let(:webhook_url) { 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' }
- let(:username) { 'slack_username' }
- let(:channel) { 'slack_channel' }
-
- before do
- slack.stub(
- project: project,
- project_id: project.id,
- service_hook: true,
- webhook: webhook_url
- )
-
- WebMock.stub_request(:post, webhook_url)
-
- opts = {
- title: 'Awesome issue',
- description: 'please fix'
- }
-
- issue_service = Issues::CreateService.new(project, user, opts)
- @issue = issue_service.execute
- @issues_sample_data = issue_service.hook_data(@issue, 'open')
-
- opts = {
- title: 'Awesome merge_request',
- description: 'please fix',
- source_branch: 'stable',
- target_branch: 'master'
- }
- merge_service = MergeRequests::CreateService.new(project,
- user, opts)
- @merge_request = merge_service.execute
- @merge_sample_data = merge_service.hook_data(@merge_request,
- 'open')
- end
-
- it "should call Slack API for push events" do
- slack.execute(push_sample_data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it "should call Slack API for issue events" do
- slack.execute(@issues_sample_data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it "should call Slack API for merge requests events" do
- slack.execute(@merge_sample_data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it 'should use the username as an option for slack when configured' do
- slack.stub(username: username)
- expect(Slack::Notifier).to receive(:new).
- with(webhook_url, username: username).
- and_return(
- double(:slack_service).as_null_object
- )
- slack.execute(push_sample_data)
- end
-
- it 'should use the channel as an option when it is configured' do
- slack.stub(channel: channel)
- expect(Slack::Notifier).to receive(:new).
- with(webhook_url, channel: channel).
- and_return(
- double(:slack_service).as_null_object
- )
- slack.execute(push_sample_data)
- end
- end
-
- describe "Note events" do
- let(:slack) { SlackService.new }
- let(:user) { create(:user) }
- let(:project) { create(:project, creator_id: user.id) }
- let(:issue) { create(:issue, project: project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:snippet) { create(:project_snippet, project: project) }
- let(:commit_note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'a comment on a commit') }
- let(:merge_request_note) { create(:note_on_merge_request, noteable_id: merge_request.id, note: "merge request note") }
- let(:issue_note) { create(:note_on_issue, noteable_id: issue.id, note: "issue note")}
- let(:snippet_note) { create(:note_on_project_snippet, noteable_id: snippet.id, note: "snippet note") }
- let(:webhook_url) { 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' }
-
- before do
- slack.stub(
- project: project,
- project_id: project.id,
- service_hook: true,
- webhook: webhook_url
- )
-
- WebMock.stub_request(:post, webhook_url)
- end
-
- it "should call Slack API for commit comment events" do
- data = Gitlab::NoteDataBuilder.build(commit_note, user)
- slack.execute(data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it "should call Slack API for merge request comment events" do
- data = Gitlab::NoteDataBuilder.build(merge_request_note, user)
- slack.execute(data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it "should call Slack API for issue comment events" do
- data = Gitlab::NoteDataBuilder.build(issue_note, user)
- slack.execute(data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
-
- it "should call Slack API for snippet comment events" do
- data = Gitlab::NoteDataBuilder.build(snippet_note, user)
- slack.execute(data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- end
- end
-end
diff --git a/spec/models/project_snippet_spec.rb b/spec/models/project_snippet_spec.rb
deleted file mode 100644
index 3e8f106d27fd90e5c32fc839cc80db60ce6bf907..0000000000000000000000000000000000000000
--- a/spec/models/project_snippet_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# == Schema Information
-#
-# Table name: snippets
-#
-# id :integer not null, primary key
-# title :string(255)
-# content :text
-# author_id :integer not null
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# file_name :string(255)
-# expires_at :datetime
-# type :string(255)
-# visibility_level :integer default(0), not null
-#
-
-require 'spec_helper'
-
-describe ProjectSnippet do
- describe "Associations" do
- it { is_expected.to belong_to(:project) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- it { is_expected.to validate_presence_of(:project) }
- end
-end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
deleted file mode 100644
index 879a63dd9f954585e08e46ce4618ce62e6dd84c5..0000000000000000000000000000000000000000
--- a/spec/models/project_spec.rb
+++ /dev/null
@@ -1,360 +0,0 @@
-# == Schema Information
-#
-# Table name: projects
-#
-# id :integer not null, primary key
-# name :string(255)
-# path :string(255)
-# description :text
-# created_at :datetime
-# updated_at :datetime
-# creator_id :integer
-# issues_enabled :boolean default(TRUE), not null
-# wall_enabled :boolean default(TRUE), not null
-# merge_requests_enabled :boolean default(TRUE), not null
-# wiki_enabled :boolean default(TRUE), not null
-# namespace_id :integer
-# issues_tracker :string(255) default("gitlab"), not null
-# issues_tracker_id :string(255)
-# snippets_enabled :boolean default(TRUE), not null
-# last_activity_at :datetime
-# import_url :string(255)
-# visibility_level :integer default(0), not null
-# archived :boolean default(FALSE), not null
-# import_status :string(255)
-# repository_size :float default(0.0)
-# star_count :integer default(0), not null
-# import_type :string(255)
-# import_source :string(255)
-# avatar :string(255)
-#
-
-require 'spec_helper'
-
-describe Project do
- describe 'Associations' do
- it { is_expected.to belong_to(:group) }
- it { is_expected.to belong_to(:namespace) }
- it { is_expected.to belong_to(:creator).class_name('User') }
- it { is_expected.to have_many(:users) }
- it { is_expected.to have_many(:events).dependent(:destroy) }
- it { is_expected.to have_many(:merge_requests).dependent(:destroy) }
- it { is_expected.to have_many(:issues).dependent(:destroy) }
- it { is_expected.to have_many(:milestones).dependent(:destroy) }
- it { is_expected.to have_many(:project_members).dependent(:destroy) }
- it { is_expected.to have_many(:notes).dependent(:destroy) }
- it { is_expected.to have_many(:snippets).class_name('ProjectSnippet').dependent(:destroy) }
- it { is_expected.to have_many(:deploy_keys_projects).dependent(:destroy) }
- it { is_expected.to have_many(:deploy_keys) }
- it { is_expected.to have_many(:hooks).dependent(:destroy) }
- it { is_expected.to have_many(:protected_branches).dependent(:destroy) }
- it { is_expected.to have_one(:forked_project_link).dependent(:destroy) }
- it { is_expected.to have_one(:slack_service).dependent(:destroy) }
- it { is_expected.to have_one(:pushover_service).dependent(:destroy) }
- it { is_expected.to have_one(:asana_service).dependent(:destroy) }
- end
-
- describe 'Mass assignment' do
- end
-
- describe 'Validation' do
- let!(:project) { create(:project) }
-
- it { is_expected.to validate_presence_of(:name) }
- it { is_expected.to validate_uniqueness_of(:name).scoped_to(:namespace_id) }
- it { is_expected.to ensure_length_of(:name).is_within(0..255) }
-
- it { is_expected.to validate_presence_of(:path) }
- it { is_expected.to validate_uniqueness_of(:path).scoped_to(:namespace_id) }
- it { is_expected.to ensure_length_of(:path).is_within(0..255) }
- it { is_expected.to ensure_length_of(:description).is_within(0..2000) }
- it { is_expected.to validate_presence_of(:creator) }
- it { is_expected.to ensure_length_of(:issues_tracker_id).is_within(0..255) }
- it { is_expected.to validate_presence_of(:namespace) }
-
- it 'should not allow new projects beyond user limits' do
- project2 = build(:project)
- allow(project2).to receive(:creator).and_return(double(can_create_project?: false, projects_limit: 0).as_null_object)
- expect(project2).not_to be_valid
- expect(project2.errors[:limit_reached].first).to match(/Your project limit is 0/)
- end
- end
-
- describe 'Respond to' do
- it { is_expected.to respond_to(:url_to_repo) }
- it { is_expected.to respond_to(:repo_exists?) }
- it { is_expected.to respond_to(:satellite) }
- it { is_expected.to respond_to(:update_merge_requests) }
- it { is_expected.to respond_to(:execute_hooks) }
- it { is_expected.to respond_to(:name_with_namespace) }
- it { is_expected.to respond_to(:owner) }
- it { is_expected.to respond_to(:path_with_namespace) }
- end
-
- it 'should return valid url to repo' do
- project = Project.new(path: 'somewhere')
- expect(project.url_to_repo).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + 'somewhere.git')
- end
-
- it 'returns the full web URL for this repo' do
- project = Project.new(path: 'somewhere')
- expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/somewhere")
- end
-
- it 'returns the web URL without the protocol for this repo' do
- project = Project.new(path: 'somewhere')
- expect(project.web_url_without_protocol).to eq("#{Gitlab.config.gitlab.url.split('://')[1]}/somewhere")
- end
-
- describe 'last_activity methods' do
- let(:project) { create(:project) }
- let(:last_event) { double(created_at: Time.now) }
-
- describe 'last_activity' do
- it 'should alias last_activity to last_event' do
- project.stub(last_event: last_event)
- expect(project.last_activity).to eq(last_event)
- end
- end
-
- describe 'last_activity_date' do
- it 'returns the creation date of the project\'s last event if present' do
- last_activity_event = create(:event, project: project)
- expect(project.last_activity_at.to_i).to eq(last_event.created_at.to_i)
- end
-
- it 'returns the project\'s last update date if it has no events' do
- expect(project.last_activity_date).to eq(project.updated_at)
- end
- end
- end
-
- describe :update_merge_requests do
- let(:project) { create(:project) }
- let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
- let(:key) { create(:key, user_id: project.owner.id) }
- let(:prev_commit_id) { merge_request.commits.last.id }
- let(:commit_id) { merge_request.commits.first.id }
-
- it 'should close merge request if last commit from source branch was pushed to target branch' do
- project.update_merge_requests(prev_commit_id, commit_id, "refs/heads/#{merge_request.target_branch}", key.user)
- merge_request.reload
- expect(merge_request.merged?).to be_truthy
- end
-
- it 'should update merge request commits with new one if pushed to source branch' do
- project.update_merge_requests(prev_commit_id, commit_id, "refs/heads/#{merge_request.source_branch}", key.user)
- merge_request.reload
- expect(merge_request.last_commit.id).to eq(commit_id)
- end
- end
-
- describe :find_with_namespace do
- context 'with namespace' do
- before do
- @group = create :group, name: 'gitlab'
- @project = create(:project, name: 'gitlabhq', namespace: @group)
- end
-
- it { expect(Project.find_with_namespace('gitlab/gitlabhq')).to eq(@project) }
- it { expect(Project.find_with_namespace('gitlab-ci')).to be_nil }
- end
- end
-
- describe :to_param do
- context 'with namespace' do
- before do
- @group = create :group, name: 'gitlab'
- @project = create(:project, name: 'gitlabhq', namespace: @group)
- end
-
- it { expect(@project.to_param).to eq('gitlabhq') }
- end
- end
-
- describe :repository do
- let(:project) { create(:project) }
-
- it 'should return valid repo' do
- expect(project.repository).to be_kind_of(Repository)
- end
- end
-
- describe :issue_exists? do
- let(:project) { create(:project) }
- let(:existed_issue) { create(:issue, project: project) }
- let(:not_existed_issue) { create(:issue) }
- let(:ext_project) { create(:redmine_project) }
-
- it 'should be true or if used internal tracker and issue exists' do
- expect(project.issue_exists?(existed_issue.iid)).to be_truthy
- end
-
- it 'should be false or if used internal tracker and issue not exists' do
- expect(project.issue_exists?(not_existed_issue.iid)).to be_falsey
- end
-
- it 'should always be true if used other tracker' do
- expect(ext_project.issue_exists?(rand(100))).to be_truthy
- end
- end
-
- describe :default_issues_tracker? do
- let(:project) { create(:project) }
- let(:ext_project) { create(:redmine_project) }
-
- it "should be true if used internal tracker" do
- expect(project.default_issues_tracker?).to be_truthy
- end
-
- it "should be false if used other tracker" do
- expect(ext_project.default_issues_tracker?).to be_falsey
- end
- end
-
- describe :can_have_issues_tracker_id? do
- let(:project) { create(:project) }
- let(:ext_project) { create(:redmine_project) }
-
- it 'should be true for projects with external issues tracker if issues enabled' do
- expect(ext_project.can_have_issues_tracker_id?).to be_truthy
- end
-
- it 'should be false for projects with internal issue tracker if issues enabled' do
- expect(project.can_have_issues_tracker_id?).to be_falsey
- end
-
- it 'should be always false if issues disabled' do
- project.issues_enabled = false
- ext_project.issues_enabled = false
-
- expect(project.can_have_issues_tracker_id?).to be_falsey
- expect(ext_project.can_have_issues_tracker_id?).to be_falsey
- end
- end
-
- describe :open_branches do
- let(:project) { create(:project) }
-
- before do
- project.protected_branches.create(name: 'master')
- end
-
- it { expect(project.open_branches.map(&:name)).to include('feature') }
- it { expect(project.open_branches.map(&:name)).not_to include('master') }
- end
-
- describe '#star_count' do
- it 'counts stars from multiple users' do
- user1 = create :user
- user2 = create :user
- project = create :project, :public
-
- expect(project.star_count).to eq(0)
-
- user1.toggle_star(project)
- expect(project.reload.star_count).to eq(1)
-
- user2.toggle_star(project)
- project.reload
- expect(project.reload.star_count).to eq(2)
-
- user1.toggle_star(project)
- project.reload
- expect(project.reload.star_count).to eq(1)
-
- user2.toggle_star(project)
- project.reload
- expect(project.reload.star_count).to eq(0)
- end
-
- it 'counts stars on the right project' do
- user = create :user
- project1 = create :project, :public
- project2 = create :project, :public
-
- expect(project1.star_count).to eq(0)
- expect(project2.star_count).to eq(0)
-
- user.toggle_star(project1)
- project1.reload
- project2.reload
- expect(project1.star_count).to eq(1)
- expect(project2.star_count).to eq(0)
-
- user.toggle_star(project1)
- project1.reload
- project2.reload
- expect(project1.star_count).to eq(0)
- expect(project2.star_count).to eq(0)
-
- user.toggle_star(project2)
- project1.reload
- project2.reload
- expect(project1.star_count).to eq(0)
- expect(project2.star_count).to eq(1)
-
- user.toggle_star(project2)
- project1.reload
- project2.reload
- expect(project1.star_count).to eq(0)
- expect(project2.star_count).to eq(0)
- end
-
- it 'is decremented when an upvoter account is deleted' do
- user = create :user
- project = create :project, :public
- user.toggle_star(project)
- project.reload
- expect(project.star_count).to eq(1)
- user.destroy
- project.reload
- expect(project.star_count).to eq(0)
- end
- end
-
- describe :avatar_type do
- let(:project) { create(:project) }
-
- it 'should be true if avatar is image' do
- project.update_attribute(:avatar, 'uploads/avatar.png')
- expect(project.avatar_type).to be_truthy
- end
-
- it 'should be false if avatar is html page' do
- project.update_attribute(:avatar, 'uploads/avatar.html')
- expect(project.avatar_type).to eq(['only images allowed'])
- end
- end
-
- describe :avatar_url do
- subject { project.avatar_url }
-
- let(:project) { create(:project) }
-
- context 'When avatar file is uploaded' do
- before do
- project.update_columns(avatar: 'uploads/avatar.png')
- allow(project.avatar).to receive(:present?) { true }
- end
-
- let(:avatar_path) do
- "/uploads/project/avatar/#{project.id}/uploads/avatar.png"
- end
-
- it { should eq "http://localhost#{avatar_path}" }
- end
-
- context 'When avatar file in git' do
- before do
- allow(project).to receive(:avatar_in_git) { true }
- end
-
- let(:avatar_path) do
- "/#{project.namespace.name}/#{project.path}/avatar"
- end
-
- it { should eq "http://localhost#{avatar_path}" }
- end
- end
-end
diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb
deleted file mode 100644
index 19201cc15a7f474ef27e6f3c0d0db6f885b73f92..0000000000000000000000000000000000000000
--- a/spec/models/project_team_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require "spec_helper"
-
-describe ProjectTeam do
- let(:master) { create(:user) }
- let(:reporter) { create(:user) }
- let(:guest) { create(:user) }
- let(:nonmember) { create(:user) }
-
- context 'personal project' do
- let(:project) { create(:empty_project) }
-
- before do
- project.team << [master, :master]
- project.team << [reporter, :reporter]
- project.team << [guest, :guest]
- end
-
- describe 'members collection' do
- it { expect(project.team.masters).to include(master) }
- it { expect(project.team.masters).not_to include(guest) }
- it { expect(project.team.masters).not_to include(reporter) }
- it { expect(project.team.masters).not_to include(nonmember) }
- end
-
- describe 'access methods' do
- it { expect(project.team.master?(master)).to be_truthy }
- it { expect(project.team.master?(guest)).to be_falsey }
- it { expect(project.team.master?(reporter)).to be_falsey }
- it { expect(project.team.master?(nonmember)).to be_falsey }
- it { expect(project.team.member?(nonmember)).to be_falsey }
- it { expect(project.team.member?(guest)).to be_truthy }
- end
- end
-
- context 'group project' do
- let(:group) { create(:group) }
- let(:project) { create(:empty_project, group: group) }
-
- before do
- group.add_user(master, Gitlab::Access::MASTER)
- group.add_user(reporter, Gitlab::Access::REPORTER)
- group.add_user(guest, Gitlab::Access::GUEST)
-
- # If user is a group and a project member - GitLab uses highest permission
- # So we add group guest as master and add group master as guest
- # to this project to test highest access
- project.team << [guest, :master]
- project.team << [master, :guest]
- end
-
- describe 'members collection' do
- it { expect(project.team.reporters).to include(reporter) }
- it { expect(project.team.masters).to include(master) }
- it { expect(project.team.masters).to include(guest) }
- it { expect(project.team.masters).not_to include(reporter) }
- it { expect(project.team.masters).not_to include(nonmember) }
- end
-
- describe 'access methods' do
- it { expect(project.team.reporter?(reporter)).to be_truthy }
- it { expect(project.team.master?(master)).to be_truthy }
- it { expect(project.team.master?(guest)).to be_truthy }
- it { expect(project.team.master?(reporter)).to be_falsey }
- it { expect(project.team.master?(nonmember)).to be_falsey }
- it { expect(project.team.member?(nonmember)).to be_falsey }
- it { expect(project.team.member?(guest)).to be_truthy }
- end
- end
-end
-
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
deleted file mode 100644
index 2acdb7dfddcba5af30abeda55bd60ece92488a13..0000000000000000000000000000000000000000
--- a/spec/models/project_wiki_spec.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-require "spec_helper"
-
-describe ProjectWiki do
- let(:project) { create(:empty_project) }
- let(:repository) { project.repository }
- let(:user) { project.owner }
- let(:gitlab_shell) { Gitlab::Shell.new }
- let(:project_wiki) { ProjectWiki.new(project, user) }
-
- subject { project_wiki }
- before { project_wiki.wiki }
-
- describe "#path_with_namespace" do
- it "returns the project path with namespace with the .wiki extension" do
- expect(subject.path_with_namespace).to eq(project.path_with_namespace + ".wiki")
- end
- end
-
- describe "#url_to_repo" do
- it "returns the correct ssh url to the repo" do
- expect(subject.url_to_repo).to eq(gitlab_shell.url_to_repo(subject.path_with_namespace))
- end
- end
-
- describe "#ssh_url_to_repo" do
- it "equals #url_to_repo" do
- expect(subject.ssh_url_to_repo).to eq(subject.url_to_repo)
- end
- end
-
- describe "#http_url_to_repo" do
- it "provides the full http url to the repo" do
- gitlab_url = Gitlab.config.gitlab.url
- repo_http_url = "#{gitlab_url}/#{subject.path_with_namespace}.git"
- expect(subject.http_url_to_repo).to eq(repo_http_url)
- end
- end
-
- describe "#wiki" do
- it "contains a Gollum::Wiki instance" do
- expect(subject.wiki).to be_a Gollum::Wiki
- end
-
- it "creates a new wiki repo if one does not yet exist" do
- expect(project_wiki.create_page("index", "test content")).to be_truthy
- end
-
- it "raises CouldNotCreateWikiError if it can't create the wiki repository" do
- allow(project_wiki).to receive(:init_repo).and_return(false)
- expect { project_wiki.send(:create_repo!) }.to raise_exception(ProjectWiki::CouldNotCreateWikiError)
- end
- end
-
- describe "#empty?" do
- context "when the wiki repository is empty" do
- before do
- allow_any_instance_of(Gitlab::Shell).to receive(:add_repository) do
- create_temp_repo("#{Rails.root}/tmp/test-git-base-path/non-existant.wiki.git")
- end
- allow(project).to receive(:path_with_namespace).and_return("non-existant")
- end
-
- describe '#empty?' do
- subject { super().empty? }
- it { is_expected.to be_truthy }
- end
- end
-
- context "when the wiki has pages" do
- before do
- project_wiki.create_page("index", "This is an awesome new Gollum Wiki")
- end
-
- describe '#empty?' do
- subject { super().empty? }
- it { is_expected.to be_falsey }
- end
- end
- end
-
- describe "#pages" do
- before do
- create_page("index", "This is an awesome new Gollum Wiki")
- @pages = subject.pages
- end
-
- after do
- destroy_page(@pages.first.page)
- end
-
- it "returns an array of WikiPage instances" do
- expect(@pages.first).to be_a WikiPage
- end
-
- it "returns the correct number of pages" do
- expect(@pages.count).to eq(1)
- end
- end
-
- describe "#find_page" do
- before do
- create_page("index page", "This is an awesome Gollum Wiki")
- end
-
- after do
- destroy_page(subject.pages.first.page)
- end
-
- it "returns the latest version of the page if it exists" do
- page = subject.find_page("index page")
- expect(page.title).to eq("index page")
- end
-
- it "returns nil if the page does not exist" do
- expect(subject.find_page("non-existant")).to eq(nil)
- end
-
- it "can find a page by slug" do
- page = subject.find_page("index-page")
- expect(page.title).to eq("index page")
- end
-
- it "returns a WikiPage instance" do
- page = subject.find_page("index page")
- expect(page).to be_a WikiPage
- end
- end
-
- describe '#find_file' do
- before do
- file = Gollum::File.new(subject.wiki)
- allow_any_instance_of(Gollum::Wiki).
- to receive(:file).with('image.jpg', 'master', true).
- and_return(file)
- allow_any_instance_of(Gollum::File).
- to receive(:mime_type).
- and_return('image/jpeg')
- allow_any_instance_of(Gollum::Wiki).
- to receive(:file).with('non-existant', 'master', true).
- and_return(nil)
- end
-
- after do
- allow_any_instance_of(Gollum::Wiki).to receive(:file).and_call_original
- allow_any_instance_of(Gollum::File).to receive(:mime_type).and_call_original
- end
-
- it 'returns the latest version of the file if it exists' do
- file = subject.find_file('image.jpg')
- expect(file.mime_type).to eq('image/jpeg')
- end
-
- it 'returns nil if the page does not exist' do
- expect(subject.find_file('non-existant')).to eq(nil)
- end
-
- it 'returns a Gollum::File instance' do
- file = subject.find_file('image.jpg')
- expect(file).to be_a Gollum::File
- end
- end
-
- describe "#create_page" do
- after do
- destroy_page(subject.pages.first.page)
- end
-
- it "creates a new wiki page" do
- expect(subject.create_page("test page", "this is content")).not_to eq(false)
- expect(subject.pages.count).to eq(1)
- end
-
- it "returns false when a duplicate page exists" do
- subject.create_page("test page", "content")
- expect(subject.create_page("test page", "content")).to eq(false)
- end
-
- it "stores an error message when a duplicate page exists" do
- 2.times { subject.create_page("test page", "content") }
- expect(subject.error_message).to match(/Duplicate page:/)
- end
-
- it "sets the correct commit message" do
- subject.create_page("test page", "some content", :markdown, "commit message")
- expect(subject.pages.first.page.version.message).to eq("commit message")
- end
- end
-
- describe "#update_page" do
- before do
- create_page("update-page", "some content")
- @gollum_page = subject.wiki.paged("update-page")
- subject.update_page(@gollum_page, "some other content", :markdown, "updated page")
- @page = subject.pages.first.page
- end
-
- after do
- destroy_page(@page)
- end
-
- it "updates the content of the page" do
- expect(@page.raw_data).to eq("some other content")
- end
-
- it "sets the correct commit message" do
- expect(@page.version.message).to eq("updated page")
- end
- end
-
- describe "#delete_page" do
- before do
- create_page("index", "some content")
- @page = subject.wiki.paged("index")
- end
-
- it "deletes the page" do
- subject.delete_page(@page)
- expect(subject.pages.count).to eq(0)
- end
- end
-
- private
-
- def create_temp_repo(path)
- FileUtils.mkdir_p path
- system(*%W(git init --quiet --bare -- #{path}))
- end
-
- def remove_temp_repo(path)
- FileUtils.rm_rf path
- end
-
- def commit_details
- commit = {name: user.name, email: user.email, message: "test commit"}
- end
-
- def create_page(name, content)
- subject.wiki.write_page(name, :markdown, content, commit_details)
- end
-
- def destroy_page(page)
- subject.wiki.delete_page(page, commit_details)
- end
-end
diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb
deleted file mode 100644
index 1e6937b536c418581c8800c7ab348c6116cc46c1..0000000000000000000000000000000000000000
--- a/spec/models/protected_branch_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# == Schema Information
-#
-# Table name: protected_branches
-#
-# id :integer not null, primary key
-# project_id :integer not null
-# name :string(255) not null
-# created_at :datetime
-# updated_at :datetime
-# developers_can_push :boolean default(FALSE), not null
-#
-
-require 'spec_helper'
-
-describe ProtectedBranch do
- describe 'Associations' do
- it { is_expected.to belong_to(:project) }
- end
-
- describe "Mass assignment" do
- end
-
- describe 'Validation' do
- it { is_expected.to validate_presence_of(:project) }
- it { is_expected.to validate_presence_of(:name) }
- end
-end
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
deleted file mode 100644
index f41e5a97ca34d1b9de26c90ae607b0c884efc567..0000000000000000000000000000000000000000
--- a/spec/models/repository_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe Repository do
- include RepoHelpers
-
- let(:repository) { create(:project).repository }
-
- describe :branch_names_contains do
- subject { repository.branch_names_contains(sample_commit.id) }
-
- it { is_expected.to include('master') }
- it { is_expected.not_to include('feature') }
- it { is_expected.not_to include('fix') }
- end
-
- describe :tag_names_contains do
- subject { repository.tag_names_contains(sample_commit.id) }
-
- it { is_expected.to include('v1.1.0') }
- it { is_expected.not_to include('v1.0.0') }
- end
-
- describe :last_commit_for_path do
- subject { repository.last_commit_for_path(sample_commit.id, '.gitignore').id }
-
- it { is_expected.to eq('c1acaa58bbcbc3eafe538cb8274ba387047b69f8') }
- end
-end
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
deleted file mode 100644
index 735652aea78e496cedfe441133218de6f66fec96..0000000000000000000000000000000000000000
--- a/spec/models/service_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-# == Schema Information
-#
-# Table name: services
-#
-# id :integer not null, primary key
-# type :string(255)
-# title :string(255)
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# active :boolean default(FALSE), not null
-# properties :text
-# template :boolean default(FALSE)
-# push_events :boolean default(TRUE)
-# issues_events :boolean default(TRUE)
-# merge_requests_events :boolean default(TRUE)
-# tag_push_events :boolean default(TRUE)
-#
-
-require 'spec_helper'
-
-describe Service do
-
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Test Button" do
- before do
- @service = Service.new
- end
-
- describe "Testable" do
- let (:project) { create :project }
-
- before do
- @service.stub(
- project: project
- )
- @testable = @service.can_test?
- end
-
- describe :can_test do
- it { expect(@testable).to eq(true) }
- end
- end
-
- describe "With commits" do
- let (:project) { create :project }
-
- before do
- @service.stub(
- project: project
- )
- @testable = @service.can_test?
- end
-
- describe :can_test do
- it { expect(@testable).to eq(true) }
- end
- end
- end
-
- describe "Template" do
- describe "for pushover service" do
- let(:service_template) {
- PushoverService.create(template: true, properties: {device: 'MyDevice', sound: 'mic', priority: 4, api_key: '123456789'})
- }
- let(:project) { create(:project) }
-
- describe 'should be prefilled for projects pushover service' do
- before do
- service_template
- project.build_missing_services
- end
-
- it "should have all fields prefilled" do
- service = project.pushover_service
- expect(service.template).to eq(false)
- expect(service.device).to eq('MyDevice')
- expect(service.sound).to eq('mic')
- expect(service.priority).to eq(4)
- expect(service.api_key).to eq('123456789')
- end
- end
- end
- end
-end
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
deleted file mode 100644
index e37dcc752306869e34bff90528367d313069e600..0000000000000000000000000000000000000000
--- a/spec/models/snippet_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# == Schema Information
-#
-# Table name: snippets
-#
-# id :integer not null, primary key
-# title :string(255)
-# content :text
-# author_id :integer not null
-# project_id :integer
-# created_at :datetime
-# updated_at :datetime
-# file_name :string(255)
-# expires_at :datetime
-# type :string(255)
-# visibility_level :integer default(0), not null
-#
-
-require 'spec_helper'
-
-describe Snippet do
- describe "Associations" do
- it { is_expected.to belong_to(:author).class_name('User') }
- it { is_expected.to have_many(:notes).dependent(:destroy) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- it { is_expected.to validate_presence_of(:author) }
-
- it { is_expected.to validate_presence_of(:title) }
- it { is_expected.to ensure_length_of(:title).is_within(0..255) }
-
- it { is_expected.to validate_presence_of(:file_name) }
- it { is_expected.to ensure_length_of(:title).is_within(0..255) }
-
- it { is_expected.to validate_presence_of(:content) }
- end
-end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
deleted file mode 100644
index 24384e8bf2277dbc4cd54f81ee27076d0a9db6d1..0000000000000000000000000000000000000000
--- a/spec/models/user_spec.rb
+++ /dev/null
@@ -1,532 +0,0 @@
-# == Schema Information
-#
-# Table name: users
-#
-# id :integer not null, primary key
-# email :string(255) default(""), not null
-# encrypted_password :string(255) default(""), not null
-# reset_password_token :string(255)
-# reset_password_sent_at :datetime
-# remember_created_at :datetime
-# sign_in_count :integer default(0)
-# current_sign_in_at :datetime
-# last_sign_in_at :datetime
-# current_sign_in_ip :string(255)
-# last_sign_in_ip :string(255)
-# created_at :datetime
-# updated_at :datetime
-# name :string(255)
-# admin :boolean default(FALSE), not null
-# projects_limit :integer default(10)
-# skype :string(255) default(""), not null
-# linkedin :string(255) default(""), not null
-# twitter :string(255) default(""), not null
-# authentication_token :string(255)
-# theme_id :integer default(1), not null
-# bio :string(255)
-# failed_attempts :integer default(0)
-# locked_at :datetime
-# username :string(255)
-# can_create_group :boolean default(TRUE), not null
-# can_create_team :boolean default(TRUE), not null
-# state :string(255)
-# color_scheme_id :integer default(1), not null
-# notification_level :integer default(1), not null
-# password_expires_at :datetime
-# created_by_id :integer
-# last_credential_check_at :datetime
-# avatar :string(255)
-# confirmation_token :string(255)
-# confirmed_at :datetime
-# confirmation_sent_at :datetime
-# unconfirmed_email :string(255)
-# hide_no_ssh_key :boolean default(FALSE)
-# website_url :string(255) default(""), not null
-# github_access_token :string(255)
-# gitlab_access_token :string(255)
-# notification_email :string(255)
-# hide_no_password :boolean default(FALSE)
-# password_automatically_set :boolean default(FALSE)
-# bitbucket_access_token :string(255)
-# bitbucket_access_token_secret :string(255)
-#
-
-require 'spec_helper'
-
-describe User do
- describe "Associations" do
- it { is_expected.to have_one(:namespace) }
- it { is_expected.to have_many(:snippets).class_name('Snippet').dependent(:destroy) }
- it { is_expected.to have_many(:project_members).dependent(:destroy) }
- it { is_expected.to have_many(:groups) }
- it { is_expected.to have_many(:keys).dependent(:destroy) }
- it { is_expected.to have_many(:events).class_name('Event').dependent(:destroy) }
- it { is_expected.to have_many(:recent_events).class_name('Event') }
- it { is_expected.to have_many(:issues).dependent(:destroy) }
- it { is_expected.to have_many(:notes).dependent(:destroy) }
- it { is_expected.to have_many(:assigned_issues).dependent(:destroy) }
- it { is_expected.to have_many(:merge_requests).dependent(:destroy) }
- it { is_expected.to have_many(:assigned_merge_requests).dependent(:destroy) }
- it { is_expected.to have_many(:identities).dependent(:destroy) }
- end
-
- describe "Mass assignment" do
- end
-
- describe 'validations' do
- it { is_expected.to validate_presence_of(:username) }
- it { is_expected.to validate_presence_of(:projects_limit) }
- it { is_expected.to validate_numericality_of(:projects_limit) }
- it { is_expected.to allow_value(0).for(:projects_limit) }
- it { is_expected.not_to allow_value(-1).for(:projects_limit) }
-
- it { is_expected.to ensure_length_of(:bio).is_within(0..255) }
-
- describe 'email' do
- it 'accepts info@example.com' do
- user = build(:user, email: 'info@example.com')
- expect(user).to be_valid
- end
-
- it 'accepts info+test@example.com' do
- user = build(:user, email: 'info+test@example.com')
- expect(user).to be_valid
- end
-
- it "accepts o'reilly@example.com" do
- user = build(:user, email: "o'reilly@example.com")
- expect(user).to be_valid
- end
-
- it 'rejects test@test@example.com' do
- user = build(:user, email: 'test@test@example.com')
- expect(user).to be_invalid
- end
-
- it 'rejects mailto:test@example.com' do
- user = build(:user, email: 'mailto:test@example.com')
- expect(user).to be_invalid
- end
-
- it "rejects lol!'+=?><#$%^&*()@gmail.com" do
- user = build(:user, email: "lol!'+=?><#$%^&*()@gmail.com")
- expect(user).to be_invalid
- end
- end
- end
-
- describe "Respond to" do
- it { is_expected.to respond_to(:is_admin?) }
- it { is_expected.to respond_to(:name) }
- it { is_expected.to respond_to(:private_token) }
- end
-
- describe '#generate_password' do
- it "should execute callback when force_random_password specified" do
- user = build(:user, force_random_password: true)
- expect(user).to receive(:generate_password)
- user.save
- end
-
- it "should not generate password by default" do
- user = create(:user, password: 'abcdefghe')
- expect(user.password).to eq('abcdefghe')
- end
-
- it "should generate password when forcing random password" do
- allow(Devise).to receive(:friendly_token).and_return('123456789')
- user = create(:user, password: 'abcdefg', force_random_password: true)
- expect(user.password).to eq('12345678')
- end
- end
-
- describe 'authentication token' do
- it "should have authentication token" do
- user = create(:user)
- expect(user.authentication_token).not_to be_blank
- end
- end
-
- describe 'projects' do
- before do
- @user = create :user
- @project = create :project, namespace: @user.namespace
- @project_2 = create :project, group: create(:group) # Grant MASTER access to the user
- @project_3 = create :project, group: create(:group) # Grant DEVELOPER access to the user
-
- @project_2.team << [@user, :master]
- @project_3.team << [@user, :developer]
- end
-
- it { expect(@user.authorized_projects).to include(@project) }
- it { expect(@user.authorized_projects).to include(@project_2) }
- it { expect(@user.authorized_projects).to include(@project_3) }
- it { expect(@user.owned_projects).to include(@project) }
- it { expect(@user.owned_projects).not_to include(@project_2) }
- it { expect(@user.owned_projects).not_to include(@project_3) }
- it { expect(@user.personal_projects).to include(@project) }
- it { expect(@user.personal_projects).not_to include(@project_2) }
- it { expect(@user.personal_projects).not_to include(@project_3) }
- end
-
- describe 'groups' do
- before do
- @user = create :user
- @group = create :group
- @group.add_owner(@user)
- end
-
- it { expect(@user.several_namespaces?).to be_truthy }
- it { expect(@user.authorized_groups).to eq([@group]) }
- it { expect(@user.owned_groups).to eq([@group]) }
- end
-
- describe 'group multiple owners' do
- before do
- @user = create :user
- @user2 = create :user
- @group = create :group
- @group.add_owner(@user)
-
- @group.add_user(@user2, GroupMember::OWNER)
- end
-
- it { expect(@user2.several_namespaces?).to be_truthy }
- end
-
- describe 'namespaced' do
- before do
- @user = create :user
- @project = create :project, namespace: @user.namespace
- end
-
- it { expect(@user.several_namespaces?).to be_falsey }
- end
-
- describe 'blocking user' do
- let(:user) { create(:user, name: 'John Smith') }
-
- it "should block user" do
- user.block
- expect(user.blocked?).to be_truthy
- end
- end
-
- describe 'filter' do
- before do
- User.delete_all
- @user = create :user
- @admin = create :user, admin: true
- @blocked = create :user, state: :blocked
- end
-
- it { expect(User.filter("admins")).to eq([@admin]) }
- it { expect(User.filter("blocked")).to eq([@blocked]) }
- it { expect(User.filter("wop")).to include(@user, @admin, @blocked) }
- it { expect(User.filter(nil)).to include(@user, @admin) }
- end
-
- describe :not_in_project do
- before do
- User.delete_all
- @user = create :user
- @project = create :project
- end
-
- it { expect(User.not_in_project(@project)).to include(@user, @project.owner) }
- end
-
- describe 'user creation' do
- describe 'normal user' do
- let(:user) { create(:user, name: 'John Smith') }
-
- it { expect(user.is_admin?).to be_falsey }
- it { expect(user.require_ssh_key?).to be_truthy }
- it { expect(user.can_create_group?).to be_truthy }
- it { expect(user.can_create_project?).to be_truthy }
- it { expect(user.first_name).to eq('John') }
- end
-
- describe 'with defaults' do
- let(:user) { User.new }
-
- it "should apply defaults to user" do
- expect(user.projects_limit).to eq(Gitlab.config.gitlab.default_projects_limit)
- expect(user.can_create_group).to eq(Gitlab.config.gitlab.default_can_create_group)
- expect(user.theme_id).to eq(Gitlab.config.gitlab.default_theme)
- end
- end
-
- describe 'with default overrides' do
- let(:user) { User.new(projects_limit: 123, can_create_group: false, can_create_team: true, theme_id: Gitlab::Theme::BASIC) }
-
- it "should apply defaults to user" do
- expect(user.projects_limit).to eq(123)
- expect(user.can_create_group).to be_falsey
- expect(user.theme_id).to eq(Gitlab::Theme::BASIC)
- end
- end
- end
-
- describe 'search' do
- let(:user1) { create(:user, username: 'James', email: 'james@testing.com') }
- let(:user2) { create(:user, username: 'jameson', email: 'jameson@example.com') }
-
- it "should be case insensitive" do
- expect(User.search(user1.username.upcase).to_a).to eq([user1])
- expect(User.search(user1.username.downcase).to_a).to eq([user1])
- expect(User.search(user2.username.upcase).to_a).to eq([user2])
- expect(User.search(user2.username.downcase).to_a).to eq([user2])
- expect(User.search(user1.username.downcase).to_a.count).to eq(2)
- expect(User.search(user2.username.downcase).to_a.count).to eq(1)
- end
- end
-
- describe 'by_username_or_id' do
- let(:user1) { create(:user, username: 'foo') }
-
- it "should get the correct user" do
- expect(User.by_username_or_id(user1.id)).to eq(user1)
- expect(User.by_username_or_id('foo')).to eq(user1)
- expect(User.by_username_or_id(-1)).to be_nil
- expect(User.by_username_or_id('bar')).to be_nil
- end
- end
-
- describe '.by_login' do
- let(:username) { 'John' }
- let!(:user) { create(:user, username: username) }
-
- it 'should get the correct user' do
- expect(User.by_login(user.email.upcase)).to eq user
- expect(User.by_login(user.email)).to eq user
- expect(User.by_login(username.downcase)).to eq user
- expect(User.by_login(username)).to eq user
- expect(User.by_login(nil)).to be_nil
- expect(User.by_login('')).to be_nil
- end
- end
-
- describe 'all_ssh_keys' do
- it { is_expected.to have_many(:keys).dependent(:destroy) }
-
- it "should have all ssh keys" do
- user = create :user
- key = create :key, key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD33bWLBxu48Sev9Fert1yzEO4WGcWglWF7K/AwblIUFselOt/QdOL9DSjpQGxLagO1s9wl53STIO8qGS4Ms0EJZyIXOEFMjFJ5xmjSy+S37By4sG7SsltQEHMxtbtFOaW5LV2wCrX+rUsRNqLMamZjgjcPO0/EgGCXIGMAYW4O7cwGZdXWYIhQ1Vwy+CsVMDdPkPgBXqK7nR/ey8KMs8ho5fMNgB5hBw/AL9fNGhRw3QTD6Q12Nkhl4VZES2EsZqlpNnJttnPdp847DUsT6yuLRlfiQfz5Cn9ysHFdXObMN5VYIiPFwHeYCZp1X2S4fDZooRE8uOLTfxWHPXwrhqSH", user_id: user.id
-
- expect(user.all_ssh_keys).to include(key.key)
- end
- end
-
- describe :avatar_type do
- let(:user) { create(:user) }
-
- it "should be true if avatar is image" do
- user.update_attribute(:avatar, 'uploads/avatar.png')
- expect(user.avatar_type).to be_truthy
- end
-
- it "should be false if avatar is html page" do
- user.update_attribute(:avatar, 'uploads/avatar.html')
- expect(user.avatar_type).to eq(["only images allowed"])
- end
- end
-
- describe :requires_ldap_check? do
- let(:user) { User.new }
-
- it 'is false when LDAP is disabled' do
- # Create a condition which would otherwise cause 'true' to be returned
- user.stub(ldap_user?: true)
- user.last_credential_check_at = nil
- expect(user.requires_ldap_check?).to be_falsey
- end
-
- context 'when LDAP is enabled' do
- before { Gitlab.config.ldap.stub(enabled: true) }
-
- it 'is false for non-LDAP users' do
- user.stub(ldap_user?: false)
- expect(user.requires_ldap_check?).to be_falsey
- end
-
- context 'and when the user is an LDAP user' do
- before { user.stub(ldap_user?: true) }
-
- it 'is true when the user has never had an LDAP check before' do
- user.last_credential_check_at = nil
- expect(user.requires_ldap_check?).to be_truthy
- end
-
- it 'is true when the last LDAP check happened over 1 hour ago' do
- user.last_credential_check_at = 2.hours.ago
- expect(user.requires_ldap_check?).to be_truthy
- end
- end
- end
- end
-
- describe :ldap_user? do
- it "is true if provider name starts with ldap" do
- user = create(:omniauth_user, provider: 'ldapmain')
- expect( user.ldap_user? ).to be_truthy
- end
-
- it "is false for other providers" do
- user = create(:omniauth_user, provider: 'other-provider')
- expect( user.ldap_user? ).to be_falsey
- end
-
- it "is false if no extern_uid is provided" do
- user = create(:omniauth_user, extern_uid: nil)
- expect( user.ldap_user? ).to be_falsey
- end
- end
-
- describe :ldap_identity do
- it "returns ldap identity" do
- user = create :omniauth_user
- expect(user.ldap_identity.provider).not_to be_empty
- end
- end
-
- describe '#full_website_url' do
- let(:user) { create(:user) }
-
- it 'begins with http if website url omits it' do
- user.website_url = 'test.com'
-
- expect(user.full_website_url).to eq 'http://test.com'
- end
-
- it 'begins with http if website url begins with http' do
- user.website_url = 'http://test.com'
-
- expect(user.full_website_url).to eq 'http://test.com'
- end
-
- it 'begins with https if website url begins with https' do
- user.website_url = 'https://test.com'
-
- expect(user.full_website_url).to eq 'https://test.com'
- end
- end
-
- describe '#short_website_url' do
- let(:user) { create(:user) }
-
- it 'does not begin with http if website url omits it' do
- user.website_url = 'test.com'
-
- expect(user.short_website_url).to eq 'test.com'
- end
-
- it 'does not begin with http if website url begins with http' do
- user.website_url = 'http://test.com'
-
- expect(user.short_website_url).to eq 'test.com'
- end
-
- it 'does not begin with https if website url begins with https' do
- user.website_url = 'https://test.com'
-
- expect(user.short_website_url).to eq 'test.com'
- end
- end
-
- describe "#starred?" do
- it "determines if user starred a project" do
- user = create :user
- project1 = create :project, :public
- project2 = create :project, :public
-
- expect(user.starred?(project1)).to be_falsey
- expect(user.starred?(project2)).to be_falsey
-
- star1 = UsersStarProject.create!(project: project1, user: user)
- expect(user.starred?(project1)).to be_truthy
- expect(user.starred?(project2)).to be_falsey
-
- star2 = UsersStarProject.create!(project: project2, user: user)
- expect(user.starred?(project1)).to be_truthy
- expect(user.starred?(project2)).to be_truthy
-
- star1.destroy
- expect(user.starred?(project1)).to be_falsey
- expect(user.starred?(project2)).to be_truthy
-
- star2.destroy
- expect(user.starred?(project1)).to be_falsey
- expect(user.starred?(project2)).to be_falsey
- end
- end
-
- describe "#toggle_star" do
- it "toggles stars" do
- user = create :user
- project = create :project, :public
-
- expect(user.starred?(project)).to be_falsey
- user.toggle_star(project)
- expect(user.starred?(project)).to be_truthy
- user.toggle_star(project)
- expect(user.starred?(project)).to be_falsey
- end
- end
-
- describe "#sort" do
- before do
- User.delete_all
- @user = create :user, created_at: Date.today, last_sign_in_at: Date.today, name: 'Alpha'
- @user1 = create :user, created_at: Date.today - 1, last_sign_in_at: Date.today - 1, name: 'Omega'
- end
-
- it "sorts users as recently_signed_in" do
- expect(User.sort('recent_sign_in').first).to eq(@user)
- end
-
- it "sorts users as late_signed_in" do
- expect(User.sort('oldest_sign_in').first).to eq(@user1)
- end
-
- it "sorts users as recently_created" do
- expect(User.sort('created_desc').first).to eq(@user)
- end
-
- it "sorts users as late_created" do
- expect(User.sort('created_asc').first).to eq(@user1)
- end
-
- it "sorts users by name when nil is passed" do
- expect(User.sort(nil).first).to eq(@user)
- end
- end
-
- describe "#contributed_projects_ids" do
-
- subject { create(:user) }
- let!(:project1) { create(:project) }
- let!(:project2) { create(:project, forked_from_project: project3) }
- let!(:project3) { create(:project) }
- let!(:merge_request) { create(:merge_request, source_project: project2, target_project: project3, author: subject) }
- let!(:push_event) { create(:event, action: Event::PUSHED, project: project1, target: project1, author: subject) }
- let!(:merge_event) { create(:event, action: Event::CREATED, project: project3, target: merge_request, author: subject) }
-
- before do
- project1.team << [subject, :master]
- project2.team << [subject, :master]
- end
-
- it "includes IDs for projects the user has pushed to" do
- expect(subject.contributed_projects_ids).to include(project1.id)
- end
-
- it "includes IDs for projects the user has had merge requests merged into" do
- expect(subject.contributed_projects_ids).to include(project3.id)
- end
-
- it "doesn't include IDs for unrelated projects" do
- expect(subject.contributed_projects_ids).not_to include(project2.id)
- end
- end
-end
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
deleted file mode 100644
index fceb7668cac4cf22dcb1b73d97b021ba2137057c..0000000000000000000000000000000000000000
--- a/spec/models/wiki_page_spec.rb
+++ /dev/null
@@ -1,210 +0,0 @@
-require "spec_helper"
-
-describe WikiPage do
- let(:project) { create(:empty_project) }
- let(:user) { project.owner }
- let(:wiki) { ProjectWiki.new(project, user) }
-
- subject { WikiPage.new(wiki) }
-
- describe "#initialize" do
- context "when initialized with an existing gollum page" do
- before do
- create_page("test page", "test content")
- @page = wiki.wiki.paged("test page")
- @wiki_page = WikiPage.new(wiki, @page, true)
- end
-
- it "sets the slug attribute" do
- expect(@wiki_page.slug).to eq("test-page")
- end
-
- it "sets the title attribute" do
- expect(@wiki_page.title).to eq("test page")
- end
-
- it "sets the formatted content attribute" do
- expect(@wiki_page.content).to eq("test content")
- end
-
- it "sets the format attribute" do
- expect(@wiki_page.format).to eq(:markdown)
- end
-
- it "sets the message attribute" do
- expect(@wiki_page.message).to eq("test commit")
- end
-
- it "sets the version attribute" do
- expect(@wiki_page.version).to be_a Gollum::Git::Commit
- end
- end
- end
-
- describe "validations" do
- before do
- subject.attributes = {title: 'title', content: 'content'}
- end
-
- it "validates presence of title" do
- subject.attributes.delete(:title)
- expect(subject.valid?).to be_falsey
- end
-
- it "validates presence of content" do
- subject.attributes.delete(:content)
- expect(subject.valid?).to be_falsey
- end
- end
-
- before do
- @wiki_attr = {title: "Index", content: "Home Page", format: "markdown"}
- end
-
- describe "#create" do
- after do
- destroy_page("Index")
- end
-
- context "with valid attributes" do
- it "saves the wiki page" do
- subject.create(@wiki_attr)
- expect(wiki.find_page("Index")).not_to be_nil
- end
-
- it "returns true" do
- expect(subject.create(@wiki_attr)).to eq(true)
- end
- end
- end
-
- describe "dot in the title" do
- let(:title) { 'Index v1.2.3' }
-
- before do
- @wiki_attr = {title: title, content: "Home Page", format: "markdown"}
- end
-
- describe "#create" do
- after do
- destroy_page(title)
- end
-
- context "with valid attributes" do
- it "saves the wiki page" do
- subject.create(@wiki_attr)
- expect(wiki.find_page(title)).not_to be_nil
- end
-
- it "returns true" do
- expect(subject.create(@wiki_attr)).to eq(true)
- end
- end
- end
-
- describe "#update" do
- before do
- create_page(title, "content")
- @page = wiki.find_page(title)
- end
-
- it "updates the content of the page" do
- @page.update("new content")
- @page = wiki.find_page(title)
- end
-
- it "returns true" do
- expect(@page.update("more content")).to be_truthy
- end
- end
- end
-
- describe "#update" do
- before do
- create_page("Update", "content")
- @page = wiki.find_page("Update")
- end
-
- after do
- destroy_page("Update")
- end
-
- context "with valid attributes" do
- it "updates the content of the page" do
- @page.update("new content")
- @page = wiki.find_page("Update")
- end
-
- it "returns true" do
- expect(@page.update("more content")).to be_truthy
- end
- end
- end
-
- describe "#destroy" do
- before do
- create_page("Delete Page", "content")
- @page = wiki.find_page("Delete Page")
- end
-
- it "should delete the page" do
- @page.delete
- expect(wiki.pages).to be_empty
- end
-
- it "should return true" do
- expect(@page.delete).to eq(true)
- end
- end
-
- describe "#versions" do
- before do
- create_page("Update", "content")
- @page = wiki.find_page("Update")
- end
-
- after do
- destroy_page("Update")
- end
-
- it "returns an array of all commits for the page" do
- 3.times { |i| @page.update("content #{i}") }
- expect(@page.versions.count).to eq(4)
- end
- end
-
- describe "#title" do
- before do
- create_page("Title", "content")
- @page = wiki.find_page("Title")
- end
-
- after do
- destroy_page("Title")
- end
-
- it "should be replace a hyphen to a space" do
- @page.title = "Import-existing-repositories-into-GitLab"
- expect(@page.title).to eq("Import existing repositories into GitLab")
- end
- end
-
- private
-
- def remove_temp_repo(path)
- FileUtils.rm_rf path
- end
-
- def commit_details
- commit = {name: user.name, email: user.email, message: "test commit"}
- end
-
- def create_page(name, content)
- wiki.wiki.write_page(name, :markdown, content, commit_details)
- end
-
- def destroy_page(title)
- page = wiki.wiki.paged(title)
- wiki.wiki.delete_page(page, commit_details)
- end
-end
diff --git a/spec/requests/api/api_helpers_spec.rb b/spec/requests/api/api_helpers_spec.rb
deleted file mode 100644
index 20cb30a39bb208cc11d05795b21fd57f6c687a48..0000000000000000000000000000000000000000
--- a/spec/requests/api/api_helpers_spec.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-require 'spec_helper'
-
-describe API, api: true do
- include API::APIHelpers
- include ApiHelpers
- let(:user) { create(:user) }
- let(:admin) { create(:admin) }
- let(:key) { create(:key, user: user) }
-
- let(:params) { {} }
- let(:env) { {} }
-
- def set_env(token_usr, identifier)
- clear_env
- clear_param
- env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = token_usr.private_token
- env[API::APIHelpers::SUDO_HEADER] = identifier
- end
-
- def set_param(token_usr, identifier)
- clear_env
- clear_param
- params[API::APIHelpers::PRIVATE_TOKEN_PARAM] = token_usr.private_token
- params[API::APIHelpers::SUDO_PARAM] = identifier
- end
-
- def clear_env
- env.delete(API::APIHelpers::PRIVATE_TOKEN_HEADER)
- env.delete(API::APIHelpers::SUDO_HEADER)
- end
-
- def clear_param
- params.delete(API::APIHelpers::PRIVATE_TOKEN_PARAM)
- params.delete(API::APIHelpers::SUDO_PARAM)
- end
-
- def error!(message, status)
- raise Exception
- end
-
- describe ".current_user" do
- it "should return nil for an invalid token" do
- env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = 'invalid token'
- allow_any_instance_of(self.class).to receive(:doorkeeper_guard){ false }
- expect(current_user).to be_nil
- end
-
- it "should return nil for a user without access" do
- env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = user.private_token
- Gitlab::UserAccess.stub(allowed?: false)
- expect(current_user).to be_nil
- end
-
- it "should leave user as is when sudo not specified" do
- env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = user.private_token
- expect(current_user).to eq(user)
- clear_env
- params[API::APIHelpers::PRIVATE_TOKEN_PARAM] = user.private_token
- expect(current_user).to eq(user)
- end
-
- it "should change current user to sudo when admin" do
- set_env(admin, user.id)
- expect(current_user).to eq(user)
- set_param(admin, user.id)
- expect(current_user).to eq(user)
- set_env(admin, user.username)
- expect(current_user).to eq(user)
- set_param(admin, user.username)
- expect(current_user).to eq(user)
- end
-
- it "should throw an error when the current user is not an admin and attempting to sudo" do
- set_env(user, admin.id)
- expect { current_user }.to raise_error
- set_param(user, admin.id)
- expect { current_user }.to raise_error
- set_env(user, admin.username)
- expect { current_user }.to raise_error
- set_param(user, admin.username)
- expect { current_user }.to raise_error
- end
-
- it "should throw an error when the user cannot be found for a given id" do
- id = user.id + admin.id
- expect(user.id).not_to eq(id)
- expect(admin.id).not_to eq(id)
- set_env(admin, id)
- expect { current_user }.to raise_error
-
- set_param(admin, id)
- expect { current_user }.to raise_error
- end
-
- it "should throw an error when the user cannot be found for a given username" do
- username = "#{user.username}#{admin.username}"
- expect(user.username).not_to eq(username)
- expect(admin.username).not_to eq(username)
- set_env(admin, username)
- expect { current_user }.to raise_error
-
- set_param(admin, username)
- expect { current_user }.to raise_error
- end
-
- it "should handle sudo's to oneself" do
- set_env(admin, admin.id)
- expect(current_user).to eq(admin)
- set_param(admin, admin.id)
- expect(current_user).to eq(admin)
- set_env(admin, admin.username)
- expect(current_user).to eq(admin)
- set_param(admin, admin.username)
- expect(current_user).to eq(admin)
- end
-
- it "should handle multiple sudo's to oneself" do
- set_env(admin, user.id)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
- set_env(admin, user.username)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
-
- set_param(admin, user.id)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
- set_param(admin, user.username)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
- end
-
- it "should handle multiple sudo's to oneself using string ids" do
- set_env(admin, user.id.to_s)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
-
- set_param(admin, user.id.to_s)
- expect(current_user).to eq(user)
- expect(current_user).to eq(user)
- end
- end
-
- describe '.sudo_identifier' do
- it "should return integers when input is an int" do
- set_env(admin, '123')
- expect(sudo_identifier).to eq(123)
- set_env(admin, '0001234567890')
- expect(sudo_identifier).to eq(1234567890)
-
- set_param(admin, '123')
- expect(sudo_identifier).to eq(123)
- set_param(admin, '0001234567890')
- expect(sudo_identifier).to eq(1234567890)
- end
-
- it "should return string when input is an is not an int" do
- set_env(admin, '12.30')
- expect(sudo_identifier).to eq("12.30")
- set_env(admin, 'hello')
- expect(sudo_identifier).to eq('hello')
- set_env(admin, ' 123')
- expect(sudo_identifier).to eq(' 123')
-
- set_param(admin, '12.30')
- expect(sudo_identifier).to eq("12.30")
- set_param(admin, 'hello')
- expect(sudo_identifier).to eq('hello')
- set_param(admin, ' 123')
- expect(sudo_identifier).to eq(' 123')
- end
- end
-end
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb
deleted file mode 100644
index f40d68b75a4ea2399760d6714e57f55b618d2e11..0000000000000000000000000000000000000000
--- a/spec/requests/api/branches_spec.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-require 'spec_helper'
-require 'mime/types'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
- let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
- let!(:branch_name) { 'feature' }
- let!(:branch_sha) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' }
-
- describe "GET /projects/:id/repository/branches" do
- it "should return an array of project branches" do
- get api("/projects/#{project.id}/repository/branches", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['name']).to eq(project.repository.branch_names.first)
- end
- end
-
- describe "GET /projects/:id/repository/branches/:branch" do
- it "should return the branch information for a single branch" do
- get api("/projects/#{project.id}/repository/branches/#{branch_name}", user)
- expect(response.status).to eq(200)
-
- expect(json_response['name']).to eq(branch_name)
- expect(json_response['commit']['id']).to eq(branch_sha)
- expect(json_response['protected']).to eq(false)
- end
-
- it "should return a 403 error if guest" do
- get api("/projects/#{project.id}/repository/branches", user2)
- expect(response.status).to eq(403)
- end
-
- it "should return a 404 error if branch is not available" do
- get api("/projects/#{project.id}/repository/branches/unknown", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "PUT /projects/:id/repository/branches/:branch/protect" do
- it "should protect a single branch" do
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/protect", user)
- expect(response.status).to eq(200)
-
- expect(json_response['name']).to eq(branch_name)
- expect(json_response['commit']['id']).to eq(branch_sha)
- expect(json_response['protected']).to eq(true)
- end
-
- it "should return a 404 error if branch not found" do
- put api("/projects/#{project.id}/repository/branches/unknown/protect", user)
- expect(response.status).to eq(404)
- end
-
- it "should return a 403 error if guest" do
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/protect", user2)
- expect(response.status).to eq(403)
- end
-
- it "should return success when protect branch again" do
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/protect", user)
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/protect", user)
- expect(response.status).to eq(200)
- end
- end
-
- describe "PUT /projects/:id/repository/branches/:branch/unprotect" do
- it "should unprotect a single branch" do
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/unprotect", user)
- expect(response.status).to eq(200)
-
- expect(json_response['name']).to eq(branch_name)
- expect(json_response['commit']['id']).to eq(branch_sha)
- expect(json_response['protected']).to eq(false)
- end
-
- it "should return success when unprotect branch" do
- put api("/projects/#{project.id}/repository/branches/unknown/unprotect", user)
- expect(response.status).to eq(404)
- end
-
- it "should return success when unprotect branch again" do
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/unprotect", user)
- put api("/projects/#{project.id}/repository/branches/#{branch_name}/unprotect", user)
- expect(response.status).to eq(200)
- end
- end
-
- describe "POST /projects/:id/repository/branches" do
- it "should create a new branch" do
- post api("/projects/#{project.id}/repository/branches", user),
- branch_name: 'feature1',
- ref: branch_sha
-
- expect(response.status).to eq(201)
-
- expect(json_response['name']).to eq('feature1')
- expect(json_response['commit']['id']).to eq(branch_sha)
- end
-
- it "should deny for user without push access" do
- post api("/projects/#{project.id}/repository/branches", user2),
- branch_name: branch_name,
- ref: branch_sha
- expect(response.status).to eq(403)
- end
-
- it 'should return 400 if branch name is invalid' do
- post api("/projects/#{project.id}/repository/branches", user),
- branch_name: 'new design',
- ref: branch_sha
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Branch name invalid')
- end
-
- it 'should return 400 if branch already exists' do
- post api("/projects/#{project.id}/repository/branches", user),
- branch_name: 'new_design1',
- ref: branch_sha
- expect(response.status).to eq(201)
-
- post api("/projects/#{project.id}/repository/branches", user),
- branch_name: 'new_design1',
- ref: branch_sha
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Branch already exists')
- end
-
- it 'should return 400 if ref name is invalid' do
- post api("/projects/#{project.id}/repository/branches", user),
- branch_name: 'new_design3',
- ref: 'foo'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Invalid reference name')
- end
- end
-
- describe "DELETE /projects/:id/repository/branches/:branch" do
- before { Repository.any_instance.stub(rm_branch: true) }
-
- it "should remove branch" do
- delete api("/projects/#{project.id}/repository/branches/#{branch_name}", user)
- expect(response.status).to eq(200)
- expect(json_response['branch_name']).to eq(branch_name)
- end
-
- it 'should return 404 if branch not exists' do
- delete api("/projects/#{project.id}/repository/branches/foobar", user)
- expect(response.status).to eq(404)
- end
-
- it "should remove protected branch" do
- project.protected_branches.create(name: branch_name)
- delete api("/projects/#{project.id}/repository/branches/#{branch_name}", user)
- expect(response.status).to eq(405)
- expect(json_response['message']).to eq('Protected branch cant be removed')
- end
-
- it "should not remove HEAD branch" do
- delete api("/projects/#{project.id}/repository/branches/master", user)
- expect(response.status).to eq(405)
- expect(json_response['message']).to eq('Cannot remove HEAD branch')
- end
- end
-end
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
deleted file mode 100644
index 9ea60e1a4adb597c230dd5148df8a02dc93737a0..0000000000000000000000000000000000000000
--- a/spec/requests/api/commits_spec.rb
+++ /dev/null
@@ -1,149 +0,0 @@
-require 'spec_helper'
-require 'mime/types'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
- let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
- let!(:note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'a comment on a commit') }
-
- before { project.team << [user, :reporter] }
-
- describe "GET /projects/:id/repository/commits" do
- context "authorized user" do
- before { project.team << [user2, :reporter] }
-
- it "should return project commits" do
- get api("/projects/#{project.id}/repository/commits", user)
- expect(response.status).to eq(200)
-
- expect(json_response).to be_an Array
- expect(json_response.first['id']).to eq(project.repository.commit.id)
- end
- end
-
- context "unauthorized user" do
- it "should not return project commits" do
- get api("/projects/#{project.id}/repository/commits")
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe "GET /projects:id/repository/commits/:sha" do
- context "authorized user" do
- it "should return a commit by sha" do
- get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['id']).to eq(project.repository.commit.id)
- expect(json_response['title']).to eq(project.repository.commit.title)
- end
-
- it "should return a 404 error if not found" do
- get api("/projects/#{project.id}/repository/commits/invalid_sha", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "unauthorized user" do
- it "should not return the selected commit" do
- get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}")
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe "GET /projects:id/repository/commits/:sha/diff" do
- context "authorized user" do
- before { project.team << [user2, :reporter] }
-
- it "should return the diff of the selected commit" do
- get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/diff", user)
- expect(response.status).to eq(200)
-
- expect(json_response).to be_an Array
- expect(json_response.length).to be >= 1
- expect(json_response.first.keys).to include "diff"
- end
-
- it "should return a 404 error if invalid commit" do
- get api("/projects/#{project.id}/repository/commits/invalid_sha/diff", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "unauthorized user" do
- it "should not return the diff of the selected commit" do
- get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/diff")
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe 'GET /projects:id/repository/commits/:sha/comments' do
- context 'authorized user' do
- it 'should return merge_request comments' do
- get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['note']).to eq('a comment on a commit')
- expect(json_response.first['author']['id']).to eq(user.id)
- end
-
- it 'should return a 404 error if merge_request_id not found' do
- get api("/projects/#{project.id}/repository/commits/1234ab/comments", user)
- expect(response.status).to eq(404)
- end
- end
-
- context 'unauthorized user' do
- it 'should not return the diff of the selected commit' do
- get api("/projects/#{project.id}/repository/commits/1234ab/comments")
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe 'POST /projects:id/repository/commits/:sha/comments' do
- context 'authorized user' do
- it 'should return comment' do
- post api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments", user), note: 'My comment'
- expect(response.status).to eq(201)
- expect(json_response['note']).to eq('My comment')
- expect(json_response['path']).to be_nil
- expect(json_response['line']).to be_nil
- expect(json_response['line_type']).to be_nil
- end
-
- it 'should return the inline comment' do
- post api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments", user), note: 'My comment', path: project.repository.commit.diffs.first.new_path, line: 7, line_type: 'new'
- expect(response.status).to eq(201)
- expect(json_response['note']).to eq('My comment')
- expect(json_response['path']).to eq(project.repository.commit.diffs.first.new_path)
- expect(json_response['line']).to eq(7)
- expect(json_response['line_type']).to eq('new')
- end
-
- it 'should return 400 if note is missing' do
- post api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments", user)
- expect(response.status).to eq(400)
- end
-
- it 'should return 404 if note is attached to non existent commit' do
- post api("/projects/#{project.id}/repository/commits/1234ab/comments", user), note: 'My comment'
- expect(response.status).to eq(404)
- end
- end
-
- context 'unauthorized user' do
- it 'should not return the diff of the selected commit' do
- post api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments")
- expect(response.status).to eq(401)
- end
- end
- end
-end
diff --git a/spec/requests/api/doorkeeper_access_spec.rb b/spec/requests/api/doorkeeper_access_spec.rb
deleted file mode 100644
index 39949a9042286cafc791a6554d79b5dadbf9223f..0000000000000000000000000000000000000000
--- a/spec/requests/api/doorkeeper_access_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let!(:user) { create(:user) }
- let!(:application) { Doorkeeper::Application.create!(:name => "MyApp", :redirect_uri => "https://app.com", :owner => user) }
- let!(:token) { Doorkeeper::AccessToken.create! :application_id => application.id, :resource_owner_id => user.id }
-
-
- describe "when unauthenticated" do
- it "returns authentication success" do
- get api("/user"), :access_token => token.token
- expect(response.status).to eq(200)
- end
- end
-
- describe "when token invalid" do
- it "returns authentication error" do
- get api("/user"), :access_token => "123a"
- expect(response.status).to eq(401)
- end
- end
-
- describe "authorization by private token" do
- it "returns authentication success" do
- get api("/user", user)
- expect(response.status).to eq(200)
- end
- end
-end
diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb
deleted file mode 100644
index bab8888a631277b9c79360405c3fa5bdf6c50ac2..0000000000000000000000000000000000000000
--- a/spec/requests/api/files_spec.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let!(:project) { create(:project, namespace: user.namespace ) }
- let(:file_path) { 'files/ruby/popen.rb' }
-
- before { project.team << [user, :developer] }
-
- describe "GET /projects/:id/repository/files" do
- it "should return file info" do
- params = {
- file_path: file_path,
- ref: 'master',
- }
-
- get api("/projects/#{project.id}/repository/files", user), params
- expect(response.status).to eq(200)
- expect(json_response['file_path']).to eq(file_path)
- expect(json_response['file_name']).to eq('popen.rb')
- expect(Base64.decode64(json_response['content']).lines.first).to eq("require 'fileutils'\n")
- end
-
- it "should return a 400 bad request if no params given" do
- get api("/projects/#{project.id}/repository/files", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 404 if such file does not exist" do
- params = {
- file_path: 'app/models/application.rb',
- ref: 'master',
- }
-
- get api("/projects/#{project.id}/repository/files", user), params
- expect(response.status).to eq(404)
- end
- end
-
- describe "POST /projects/:id/repository/files" do
- let(:valid_params) {
- {
- file_path: 'newfile.rb',
- branch_name: 'master',
- content: 'puts 8',
- commit_message: 'Added newfile'
- }
- }
-
- it "should create a new file in project repo" do
- Gitlab::Satellite::NewFileAction.any_instance.stub(
- commit!: true,
- )
-
- post api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(201)
- expect(json_response['file_path']).to eq('newfile.rb')
- end
-
- it "should return a 400 bad request if no params given" do
- post api("/projects/#{project.id}/repository/files", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 400 if satellite fails to create file" do
- Gitlab::Satellite::NewFileAction.any_instance.stub(
- commit!: false,
- )
-
- post api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(400)
- end
- end
-
- describe "PUT /projects/:id/repository/files" do
- let(:valid_params) {
- {
- file_path: file_path,
- branch_name: 'master',
- content: 'puts 8',
- commit_message: 'Changed file'
- }
- }
-
- it "should update existing file in project repo" do
- Gitlab::Satellite::EditFileAction.any_instance.stub(
- commit!: true,
- )
-
- put api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(200)
- expect(json_response['file_path']).to eq(file_path)
- end
-
- it "should return a 400 bad request if no params given" do
- put api("/projects/#{project.id}/repository/files", user)
- expect(response.status).to eq(400)
- end
-
- it 'should return a 400 if the checkout fails' do
- Gitlab::Satellite::EditFileAction.any_instance.stub(:commit!)
- .and_raise(Gitlab::Satellite::CheckoutFailed)
-
- put api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(400)
-
- ref = valid_params[:branch_name]
- expect(response.body).to match("ref '#{ref}' could not be checked out")
- end
-
- it 'should return a 409 if the file was not modified' do
- Gitlab::Satellite::EditFileAction.any_instance.stub(:commit!)
- .and_raise(Gitlab::Satellite::CommitFailed)
-
- put api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(409)
- expect(response.body).to match("Maybe there was nothing to commit?")
- end
-
- it 'should return a 409 if the push fails' do
- Gitlab::Satellite::EditFileAction.any_instance.stub(:commit!)
- .and_raise(Gitlab::Satellite::PushFailed)
-
- put api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(409)
- expect(response.body).to match("Maybe the file was changed by another process?")
- end
- end
-
- describe "DELETE /projects/:id/repository/files" do
- let(:valid_params) {
- {
- file_path: file_path,
- branch_name: 'master',
- commit_message: 'Changed file'
- }
- }
-
- it "should delete existing file in project repo" do
- Gitlab::Satellite::DeleteFileAction.any_instance.stub(
- commit!: true,
- )
-
- delete api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(200)
- expect(json_response['file_path']).to eq(file_path)
- end
-
- it "should return a 400 bad request if no params given" do
- delete api("/projects/#{project.id}/repository/files", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 400 if satellite fails to create file" do
- Gitlab::Satellite::DeleteFileAction.any_instance.stub(
- commit!: false,
- )
-
- delete api("/projects/#{project.id}/repository/files", user), valid_params
- expect(response.status).to eq(400)
- end
- end
-end
diff --git a/spec/requests/api/fork_spec.rb b/spec/requests/api/fork_spec.rb
deleted file mode 100644
index fb3ff552c8d412440c4b4b6263d748cecb08ec77..0000000000000000000000000000000000000000
--- a/spec/requests/api/fork_spec.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:user3) { create(:user) }
- let(:admin) { create(:admin) }
- let(:project) {
- create(:project, creator_id: user.id,
- namespace: user.namespace)
- }
- let(:project_user2) {
- create(:project_member, user: user2,
- project: project,
- access_level: ProjectMember::GUEST)
- }
-
- describe 'POST /projects/fork/:id' do
- before { project_user2 }
- before { user3 }
-
- context 'when authenticated' do
- it 'should fork if user has sufficient access to project' do
- post api("/projects/fork/#{project.id}", user2)
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq(project.name)
- expect(json_response['path']).to eq(project.path)
- expect(json_response['owner']['id']).to eq(user2.id)
- expect(json_response['namespace']['id']).to eq(user2.namespace.id)
- expect(json_response['forked_from_project']['id']).to eq(project.id)
- end
-
- it 'should fork if user is admin' do
- post api("/projects/fork/#{project.id}", admin)
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq(project.name)
- expect(json_response['path']).to eq(project.path)
- expect(json_response['owner']['id']).to eq(admin.id)
- expect(json_response['namespace']['id']).to eq(admin.namespace.id)
- expect(json_response['forked_from_project']['id']).to eq(project.id)
- end
-
- it 'should fail on missing project access for the project to fork' do
- post api("/projects/fork/#{project.id}", user3)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Project Not Found')
- end
-
- it 'should fail if forked project exists in the user namespace' do
- post api("/projects/fork/#{project.id}", user)
- expect(response.status).to eq(409)
- expect(json_response['message']['base']).to eq(['Invalid fork destination'])
- expect(json_response['message']['name']).to eq(['has already been taken'])
- expect(json_response['message']['path']).to eq(['has already been taken'])
- end
-
- it 'should fail if project to fork from does not exist' do
- post api('/projects/fork/424242', user)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Project Not Found')
- end
- end
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- post api("/projects/fork/#{project.id}")
- expect(response.status).to eq(401)
- expect(json_response['message']).to eq('401 Unauthorized')
- end
- end
- end
-end
diff --git a/spec/requests/api/group_members_spec.rb b/spec/requests/api/group_members_spec.rb
deleted file mode 100644
index 8ba6876a95b112b5f66c28467699edca39f223bd..0000000000000000000000000000000000000000
--- a/spec/requests/api/group_members_spec.rb
+++ /dev/null
@@ -1,199 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:owner) { create(:user) }
- let(:reporter) { create(:user) }
- let(:developer) { create(:user) }
- let(:master) { create(:user) }
- let(:guest) { create(:user) }
- let(:stranger) { create(:user) }
-
- let!(:group_with_members) do
- group = create(:group)
- group.add_users([reporter.id], GroupMember::REPORTER)
- group.add_users([developer.id], GroupMember::DEVELOPER)
- group.add_users([master.id], GroupMember::MASTER)
- group.add_users([guest.id], GroupMember::GUEST)
- group
- end
-
- let!(:group_no_members) { create(:group) }
-
- before do
- group_with_members.add_owner owner
- group_no_members.add_owner owner
- end
-
- describe "GET /groups/:id/members" do
- context "when authenticated as user that is part or the group" do
- it "each user: should return an array of members groups of group3" do
- [owner, master, developer, reporter, guest].each do |user|
- get api("/groups/#{group_with_members.id}/members", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.size).to eq(5)
- expect(json_response.find { |e| e['id']==owner.id }['access_level']).to eq(GroupMember::OWNER)
- expect(json_response.find { |e| e['id']==reporter.id }['access_level']).to eq(GroupMember::REPORTER)
- expect(json_response.find { |e| e['id']==developer.id }['access_level']).to eq(GroupMember::DEVELOPER)
- expect(json_response.find { |e| e['id']==master.id }['access_level']).to eq(GroupMember::MASTER)
- expect(json_response.find { |e| e['id']==guest.id }['access_level']).to eq(GroupMember::GUEST)
- end
- end
-
- it "users not part of the group should get access error" do
- get api("/groups/#{group_with_members.id}/members", stranger)
- expect(response.status).to eq(403)
- end
- end
- end
-
- describe "POST /groups/:id/members" do
- context "when not a member of the group" do
- it "should not add guest as member of group_no_members when adding being done by person outside the group" do
- post api("/groups/#{group_no_members.id}/members", reporter), user_id: guest.id, access_level: GroupMember::MASTER
- expect(response.status).to eq(403)
- end
- end
-
- context "when a member of the group" do
- it "should return ok and add new member" do
- new_user = create(:user)
-
- expect {
- post api("/groups/#{group_no_members.id}/members", owner),
- user_id: new_user.id, access_level: GroupMember::MASTER
- }.to change { group_no_members.members.count }.by(1)
-
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq(new_user.name)
- expect(json_response['access_level']).to eq(GroupMember::MASTER)
- end
-
- it "should not allow guest to modify group members" do
- new_user = create(:user)
-
- expect {
- post api("/groups/#{group_with_members.id}/members", guest),
- user_id: new_user.id, access_level: GroupMember::MASTER
- }.not_to change { group_with_members.members.count }
-
- expect(response.status).to eq(403)
- end
-
- it "should return error if member already exists" do
- post api("/groups/#{group_with_members.id}/members", owner), user_id: master.id, access_level: GroupMember::MASTER
- expect(response.status).to eq(409)
- end
-
- it "should return a 400 error when user id is not given" do
- post api("/groups/#{group_no_members.id}/members", owner), access_level: GroupMember::MASTER
- expect(response.status).to eq(400)
- end
-
- it "should return a 400 error when access level is not given" do
- post api("/groups/#{group_no_members.id}/members", owner), user_id: master.id
- expect(response.status).to eq(400)
- end
-
- it "should return a 422 error when access level is not known" do
- post api("/groups/#{group_no_members.id}/members", owner), user_id: master.id, access_level: 1234
- expect(response.status).to eq(422)
- end
- end
- end
-
- describe 'PUT /groups/:id/members/:user_id' do
- context 'when not a member of the group' do
- it 'should return a 409 error if the user is not a group member' do
- put(
- api("/groups/#{group_no_members.id}/members/#{developer.id}",
- owner), access_level: GroupMember::MASTER
- )
- expect(response.status).to eq(404)
- end
- end
-
- context 'when a member of the group' do
- it 'should return ok and update member access level' do
- put(
- api("/groups/#{group_with_members.id}/members/#{reporter.id}",
- owner),
- access_level: GroupMember::MASTER
- )
-
- expect(response.status).to eq(200)
-
- get api("/groups/#{group_with_members.id}/members", owner)
- json_reporter = json_response.find do |e|
- e['id'] == reporter.id
- end
-
- expect(json_reporter['access_level']).to eq(GroupMember::MASTER)
- end
-
- it 'should not allow guest to modify group members' do
- put(
- api("/groups/#{group_with_members.id}/members/#{developer.id}",
- guest),
- access_level: GroupMember::MASTER
- )
-
- expect(response.status).to eq(403)
-
- get api("/groups/#{group_with_members.id}/members", owner)
- json_developer = json_response.find do |e|
- e['id'] == developer.id
- end
-
- expect(json_developer['access_level']).to eq(GroupMember::DEVELOPER)
- end
-
- it 'should return a 400 error when access level is not given' do
- put(
- api("/groups/#{group_with_members.id}/members/#{master.id}", owner)
- )
- expect(response.status).to eq(400)
- end
-
- it 'should return a 422 error when access level is not known' do
- put(
- api("/groups/#{group_with_members.id}/members/#{master.id}", owner),
- access_level: 1234
- )
- expect(response.status).to eq(422)
- end
- end
- end
-
- describe "DELETE /groups/:id/members/:user_id" do
- context "when not a member of the group" do
- it "should not delete guest's membership of group_with_members" do
- random_user = create(:user)
- delete api("/groups/#{group_with_members.id}/members/#{owner.id}", random_user)
- expect(response.status).to eq(403)
- end
- end
-
- context "when a member of the group" do
- it "should delete guest's membership of group" do
- expect {
- delete api("/groups/#{group_with_members.id}/members/#{guest.id}", owner)
- }.to change { group_with_members.members.count }.by(-1)
-
- expect(response.status).to eq(200)
- end
-
- it "should return a 404 error when user id is not known" do
- delete api("/groups/#{group_with_members.id}/members/1328", owner)
- expect(response.status).to eq(404)
- end
-
- it "should not allow guest to modify group members" do
- delete api("/groups/#{group_with_members.id}/members/#{master.id}", guest)
- expect(response.status).to eq(403)
- end
- end
- end
-end
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
deleted file mode 100644
index d963dbac9f1196b285bfd57d3cd3539f89749fe3..0000000000000000000000000000000000000000
--- a/spec/requests/api/groups_spec.rb
+++ /dev/null
@@ -1,187 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user1) { create(:user) }
- let(:user2) { create(:user) }
- let(:admin) { create(:admin) }
- let!(:group1) { create(:group) }
- let!(:group2) { create(:group) }
-
- before do
- group1.add_owner(user1)
- group2.add_owner(user2)
- end
-
- describe "GET /groups" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/groups")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated as user" do
- it "normal user: should return an array of groups of user1" do
- get api("/groups", user1)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['name']).to eq(group1.name)
- end
- end
-
- context "when authenticated as admin" do
- it "admin: should return an array of all groups" do
- get api("/groups", admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(2)
- end
- end
- end
-
- describe "GET /groups/:id" do
- context "when authenticated as user" do
- it "should return one of user1's groups" do
- get api("/groups/#{group1.id}", user1)
- expect(response.status).to eq(200)
- json_response['name'] == group1.name
- end
-
- it "should not return a non existing group" do
- get api("/groups/1328", user1)
- expect(response.status).to eq(404)
- end
-
- it "should not return a group not attached to user1" do
- get api("/groups/#{group2.id}", user1)
- expect(response.status).to eq(403)
- end
- end
-
- context "when authenticated as admin" do
- it "should return any existing group" do
- get api("/groups/#{group2.id}", admin)
- expect(response.status).to eq(200)
- json_response['name'] == group2.name
- end
-
- it "should not return a non existing group" do
- get api("/groups/1328", admin)
- expect(response.status).to eq(404)
- end
- end
-
- context 'when using group path in URL' do
- it 'should return any existing group' do
- get api("/groups/#{group1.path}", admin)
- expect(response.status).to eq(200)
- json_response['name'] == group2.name
- end
-
- it 'should not return a non existing group' do
- get api('/groups/unknown', admin)
- expect(response.status).to eq(404)
- end
-
- it 'should not return a group not attached to user1' do
- get api("/groups/#{group2.path}", user1)
- expect(response.status).to eq(403)
- end
- end
- end
-
- describe "POST /groups" do
- context "when authenticated as user" do
- it "should not create group" do
- post api("/groups", user1), attributes_for(:group)
- expect(response.status).to eq(403)
- end
- end
-
- context "when authenticated as admin" do
- it "should create group" do
- post api("/groups", admin), attributes_for(:group)
- expect(response.status).to eq(201)
- end
-
- it "should not create group, duplicate" do
- post api("/groups", admin), {name: "Duplicate Test", path: group2.path}
- expect(response.status).to eq(400)
- expect(response.message).to eq("Bad Request")
- end
-
- it "should return 400 bad request error if name not given" do
- post api("/groups", admin), {path: group2.path}
- expect(response.status).to eq(400)
- end
-
- it "should return 400 bad request error if path not given" do
- post api("/groups", admin), { name: 'test' }
- expect(response.status).to eq(400)
- end
- end
- end
-
- describe "DELETE /groups/:id" do
- context "when authenticated as user" do
- it "should remove group" do
- delete api("/groups/#{group1.id}", user1)
- expect(response.status).to eq(200)
- end
-
- it "should not remove a group if not an owner" do
- user3 = create(:user)
- group1.add_user(user3, Gitlab::Access::MASTER)
- delete api("/groups/#{group1.id}", user3)
- expect(response.status).to eq(403)
- end
-
- it "should not remove a non existing group" do
- delete api("/groups/1328", user1)
- expect(response.status).to eq(404)
- end
-
- it "should not remove a group not attached to user1" do
- delete api("/groups/#{group2.id}", user1)
- expect(response.status).to eq(403)
- end
- end
-
- context "when authenticated as admin" do
- it "should remove any existing group" do
- delete api("/groups/#{group2.id}", admin)
- expect(response.status).to eq(200)
- end
-
- it "should not remove a non existing group" do
- delete api("/groups/1328", admin)
- expect(response.status).to eq(404)
- end
- end
- end
-
- describe "POST /groups/:id/projects/:project_id" do
- let(:project) { create(:project) }
- before(:each) do
- Projects::TransferService.any_instance.stub(execute: true)
- allow(Project).to receive(:find).and_return(project)
- end
-
- context "when authenticated as user" do
- it "should not transfer project to group" do
- post api("/groups/#{group1.id}/projects/#{project.id}", user2)
- expect(response.status).to eq(403)
- end
- end
-
- context "when authenticated as admin" do
- it "should transfer project to group" do
- post api("/groups/#{group1.id}/projects/#{project.id}", admin)
- expect(response.status).to eq(201)
- end
- end
- end
-end
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
deleted file mode 100644
index 4c7d15d6594e8766b7dbb701b4d39a808190ec35..0000000000000000000000000000000000000000
--- a/spec/requests/api/internal_spec.rb
+++ /dev/null
@@ -1,229 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:key) { create(:key, user: user) }
- let(:project) { create(:project) }
- let(:secret_token) { File.read Rails.root.join('.gitlab_shell_secret') }
-
- describe "GET /internal/check", no_db: true do
- it do
- get api("/internal/check"), secret_token: secret_token
-
- expect(response.status).to eq(200)
- expect(json_response['api_version']).to eq(API::API.version)
- end
- end
-
- describe "GET /internal/broadcast_message" do
- context "broadcast message exists" do
- let!(:broadcast_message) { create(:broadcast_message, starts_at: Time.now.yesterday, ends_at: Time.now.tomorrow ) }
-
- it do
- get api("/internal/broadcast_message"), secret_token: secret_token
-
- expect(response.status).to eq(200)
- expect(json_response["message"]).to eq(broadcast_message.message)
- end
- end
-
- context "broadcast message doesn't exist" do
- it do
- get api("/internal/broadcast_message"), secret_token: secret_token
-
- expect(response.status).to eq(200)
- expect(json_response).to be_empty
- end
- end
- end
-
- describe "GET /internal/discover" do
- it do
- get(api("/internal/discover"), key_id: key.id, secret_token: secret_token)
-
- expect(response.status).to eq(200)
-
- expect(json_response['name']).to eq(user.name)
- end
- end
-
- describe "POST /internal/allowed" do
- context "access granted" do
- before do
- project.team << [user, :developer]
- end
-
- context "git pull" do
- it do
- pull(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_truthy
- end
- end
-
- context "git push" do
- it do
- push(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_truthy
- end
- end
- end
-
- context "access denied" do
- before do
- project.team << [user, :guest]
- end
-
- context "git pull" do
- it do
- pull(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
-
- context "git push" do
- it do
- push(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
- end
-
- context "blocked user" do
- let(:personal_project) { create(:project, namespace: user.namespace) }
-
- before do
- user.block
- end
-
- context "git pull" do
- it do
- pull(key, personal_project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
-
- context "git push" do
- it do
- push(key, personal_project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
- end
-
- context "archived project" do
- let(:personal_project) { create(:project, namespace: user.namespace) }
-
- before do
- project.team << [user, :developer]
- project.archive!
- end
-
- context "git pull" do
- it do
- pull(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_truthy
- end
- end
-
- context "git push" do
- it do
- push(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
- end
-
- context "deploy key" do
- let(:key) { create(:deploy_key) }
-
- context "added to project" do
- before do
- key.projects << project
- end
-
- it do
- archive(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_truthy
- end
- end
-
- context "not added to project" do
- it do
- archive(key, project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
- end
-
- context 'project does not exist' do
- it do
- pull(key, OpenStruct.new(path_with_namespace: 'gitlab/notexists'))
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
-
- context 'user does not exist' do
- it do
- pull(OpenStruct.new(id: 0), project)
-
- expect(response.status).to eq(200)
- expect(json_response["status"]).to be_falsey
- end
- end
- end
-
- def pull(key, project)
- post(
- api("/internal/allowed"),
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-upload-pack',
- secret_token: secret_token
- )
- end
-
- def push(key, project)
- post(
- api("/internal/allowed"),
- changes: 'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-receive-pack',
- secret_token: secret_token
- )
- end
-
- def archive(key, project)
- post(
- api("/internal/allowed"),
- ref: 'master',
- key_id: key.id,
- project: project.path_with_namespace,
- action: 'git-upload-archive',
- secret_token: secret_token
- )
- end
-end
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
deleted file mode 100644
index b6b0427debf93666406cf5180af659bf6af273be..0000000000000000000000000000000000000000
--- a/spec/requests/api/issues_spec.rb
+++ /dev/null
@@ -1,330 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let!(:project) { create(:project, namespace: user.namespace ) }
- let!(:closed_issue) do
- create :closed_issue,
- author: user,
- assignee: user,
- project: project,
- state: :closed,
- milestone: milestone
- end
- let!(:issue) do
- create :issue,
- author: user,
- assignee: user,
- project: project,
- milestone: milestone
- end
- let!(:label) do
- create(:label, title: 'label', color: '#FFAABB', project: project)
- end
- let!(:label_link) { create(:label_link, label: label, target: issue) }
- let!(:milestone) { create(:milestone, title: '1.0.0', project: project) }
- let!(:empty_milestone) do
- create(:milestone, title: '2.0.0', project: project)
- end
-
- before { project.team << [user, :reporter] }
-
- describe "GET /issues" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/issues")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated" do
- it "should return an array of issues" do
- get api("/issues", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(issue.title)
- end
-
- it "should add pagination headers" do
- get api("/issues?per_page=3", user)
- expect(response.headers['Link']).to eq(
- '; rel="first", ; rel="last"'
- )
- end
-
- it 'should return an array of closed issues' do
- get api('/issues?state=closed', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['id']).to eq(closed_issue.id)
- end
-
- it 'should return an array of opened issues' do
- get api('/issues?state=opened', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['id']).to eq(issue.id)
- end
-
- it 'should return an array of all issues' do
- get api('/issues?state=all', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(2)
- expect(json_response.first['id']).to eq(issue.id)
- expect(json_response.second['id']).to eq(closed_issue.id)
- end
-
- it 'should return an array of labeled issues' do
- get api("/issues?labels=#{label.title}", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['labels']).to eq([label.title])
- end
-
- it 'should return an array of labeled issues when at least one label matches' do
- get api("/issues?labels=#{label.title},foo,bar", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['labels']).to eq([label.title])
- end
-
- it 'should return an empty array if no issue matches labels' do
- get api('/issues?labels=foo,bar', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(0)
- end
-
- it 'should return an array of labeled issues matching given state' do
- get api("/issues?labels=#{label.title}&state=opened", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['labels']).to eq([label.title])
- expect(json_response.first['state']).to eq('opened')
- end
-
- it 'should return an empty array if no issue matches labels and state filters' do
- get api("/issues?labels=#{label.title}&state=closed", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(0)
- end
- end
- end
-
- describe "GET /projects/:id/issues" do
- let(:base_url) { "/projects/#{project.id}" }
- let(:title) { milestone.title }
-
- it "should return project issues" do
- get api("#{base_url}/issues", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(issue.title)
- end
-
- it 'should return an array of labeled project issues' do
- get api("#{base_url}/issues?labels=#{label.title}", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['labels']).to eq([label.title])
- end
-
- it 'should return an array of labeled project issues when at least one label matches' do
- get api("#{base_url}/issues?labels=#{label.title},foo,bar", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['labels']).to eq([label.title])
- end
-
- it 'should return an empty array if no project issue matches labels' do
- get api("#{base_url}/issues?labels=foo,bar", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(0)
- end
-
- it 'should return an empty array if no issue matches milestone' do
- get api("#{base_url}/issues?milestone=#{empty_milestone.title}", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(0)
- end
-
- it 'should return an empty array if milestone does not exist' do
- get api("#{base_url}/issues?milestone=foo", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(0)
- end
-
- it 'should return an array of issues in given milestone' do
- get api("#{base_url}/issues?milestone=#{title}", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(2)
- expect(json_response.first['id']).to eq(issue.id)
- expect(json_response.second['id']).to eq(closed_issue.id)
- end
-
- it 'should return an array of issues matching state in milestone' do
- get api("#{base_url}/issues?milestone=#{milestone.title}"\
- '&state=closed', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['id']).to eq(closed_issue.id)
- end
- end
-
- describe "GET /projects/:id/issues/:issue_id" do
- it "should return a project issue by id" do
- get api("/projects/#{project.id}/issues/#{issue.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq(issue.title)
- expect(json_response['iid']).to eq(issue.iid)
- end
-
- it "should return 404 if issue id not found" do
- get api("/projects/#{project.id}/issues/54321", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "POST /projects/:id/issues" do
- it "should create a new project issue" do
- post api("/projects/#{project.id}/issues", user),
- title: 'new issue', labels: 'label, label2'
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('new issue')
- expect(json_response['description']).to be_nil
- expect(json_response['labels']).to eq(['label', 'label2'])
- end
-
- it "should return a 400 bad request if title not given" do
- post api("/projects/#{project.id}/issues", user), labels: 'label, label2'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 on invalid label names' do
- post api("/projects/#{project.id}/issues", user),
- title: 'new issue',
- labels: 'label, ?'
- expect(response.status).to eq(400)
- expect(json_response['message']['labels']['?']['title']).to eq(['is invalid'])
- end
-
- it 'should return 400 if title is too long' do
- post api("/projects/#{project.id}/issues", user),
- title: 'g' * 256
- expect(response.status).to eq(400)
- expect(json_response['message']['title']).to eq([
- 'is too long (maximum is 255 characters)'
- ])
- end
- end
-
- describe "PUT /projects/:id/issues/:issue_id to update only title" do
- it "should update a project issue" do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- title: 'updated title'
- expect(response.status).to eq(200)
-
- expect(json_response['title']).to eq('updated title')
- end
-
- it "should return 404 error if issue id not found" do
- put api("/projects/#{project.id}/issues/44444", user),
- title: 'updated title'
- expect(response.status).to eq(404)
- end
-
- it 'should return 400 on invalid label names' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- title: 'updated title',
- labels: 'label, ?'
- expect(response.status).to eq(400)
- expect(json_response['message']['labels']['?']['title']).to eq(['is invalid'])
- end
- end
-
- describe 'PUT /projects/:id/issues/:issue_id to update labels' do
- let!(:label) { create(:label, title: 'dummy', project: project) }
- let!(:label_link) { create(:label_link, label: label, target: issue) }
-
- it 'should not update labels if not present' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- title: 'updated title'
- expect(response.status).to eq(200)
- expect(json_response['labels']).to eq([label.title])
- end
-
- it 'should remove all labels' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- labels: ''
- expect(response.status).to eq(200)
- expect(json_response['labels']).to eq([])
- end
-
- it 'should update labels' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- labels: 'foo,bar'
- expect(response.status).to eq(200)
- expect(json_response['labels']).to include 'foo'
- expect(json_response['labels']).to include 'bar'
- end
-
- it 'should return 400 on invalid label names' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- labels: 'label, ?'
- expect(response.status).to eq(400)
- expect(json_response['message']['labels']['?']['title']).to eq(['is invalid'])
- end
-
- it 'should allow special label names' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- labels: 'label:foo, label-bar,label_bar,label/bar'
- expect(response.status).to eq(200)
- expect(json_response['labels']).to include 'label:foo'
- expect(json_response['labels']).to include 'label-bar'
- expect(json_response['labels']).to include 'label_bar'
- expect(json_response['labels']).to include 'label/bar'
- end
-
- it 'should return 400 if title is too long' do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- title: 'g' * 256
- expect(response.status).to eq(400)
- expect(json_response['message']['title']).to eq([
- 'is too long (maximum is 255 characters)'
- ])
- end
- end
-
- describe "PUT /projects/:id/issues/:issue_id to update state and label" do
- it "should update a project issue" do
- put api("/projects/#{project.id}/issues/#{issue.id}", user),
- labels: 'label2', state_event: "close"
- expect(response.status).to eq(200)
-
- expect(json_response['labels']).to include 'label2'
- expect(json_response['state']).to eq "closed"
- end
- end
-
- describe "DELETE /projects/:id/issues/:issue_id" do
- it "should delete a project issue" do
- delete api("/projects/#{project.id}/issues/#{issue.id}", user)
- expect(response.status).to eq(405)
- end
- end
-end
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb
deleted file mode 100644
index aff109a942469fe8d37b61ec2ed8a5a2ed0034b9..0000000000000000000000000000000000000000
--- a/spec/requests/api/labels_spec.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user) { create(:user) }
- let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
- let!(:label1) { create(:label, title: 'label1', project: project) }
-
- before do
- project.team << [user, :master]
- end
-
-
- describe 'GET /projects/:id/labels' do
- it 'should return project labels' do
- get api("/projects/#{project.id}/labels", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.size).to eq(1)
- expect(json_response.first['name']).to eq(label1.name)
- end
- end
-
- describe 'POST /projects/:id/labels' do
- it 'should return created label' do
- post api("/projects/#{project.id}/labels", user),
- name: 'Foo',
- color: '#FFAABB'
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq('Foo')
- expect(json_response['color']).to eq('#FFAABB')
- end
-
- it 'should return a 400 bad request if name not given' do
- post api("/projects/#{project.id}/labels", user), color: '#FFAABB'
- expect(response.status).to eq(400)
- end
-
- it 'should return a 400 bad request if color not given' do
- post api("/projects/#{project.id}/labels", user), name: 'Foobar'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 for invalid color' do
- post api("/projects/#{project.id}/labels", user),
- name: 'Foo',
- color: '#FFAA'
- expect(response.status).to eq(400)
- expect(json_response['message']['color']).to eq(['is invalid'])
- end
-
- it 'should return 400 for too long color code' do
- post api("/projects/#{project.id}/labels", user),
- name: 'Foo',
- color: '#FFAAFFFF'
- expect(response.status).to eq(400)
- expect(json_response['message']['color']).to eq(['is invalid'])
- end
-
- it 'should return 400 for invalid name' do
- post api("/projects/#{project.id}/labels", user),
- name: '?',
- color: '#FFAABB'
- expect(response.status).to eq(400)
- expect(json_response['message']['title']).to eq(['is invalid'])
- end
-
- it 'should return 409 if label already exists' do
- post api("/projects/#{project.id}/labels", user),
- name: 'label1',
- color: '#FFAABB'
- expect(response.status).to eq(409)
- expect(json_response['message']).to eq('Label already exists')
- end
- end
-
- describe 'DELETE /projects/:id/labels' do
- it 'should return 200 for existing label' do
- delete api("/projects/#{project.id}/labels", user), name: 'label1'
- expect(response.status).to eq(200)
- end
-
- it 'should return 404 for non existing label' do
- delete api("/projects/#{project.id}/labels", user), name: 'label2'
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Label Not Found')
- end
-
- it 'should return 400 for wrong parameters' do
- delete api("/projects/#{project.id}/labels", user)
- expect(response.status).to eq(400)
- end
- end
-
- describe 'PUT /projects/:id/labels' do
- it 'should return 200 if name and colors are changed' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label1',
- new_name: 'New Label',
- color: '#FFFFFF'
- expect(response.status).to eq(200)
- expect(json_response['name']).to eq('New Label')
- expect(json_response['color']).to eq('#FFFFFF')
- end
-
- it 'should return 200 if name is changed' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label1',
- new_name: 'New Label'
- expect(response.status).to eq(200)
- expect(json_response['name']).to eq('New Label')
- expect(json_response['color']).to eq(label1.color)
- end
-
- it 'should return 200 if colors is changed' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label1',
- color: '#FFFFFF'
- expect(response.status).to eq(200)
- expect(json_response['name']).to eq(label1.name)
- expect(json_response['color']).to eq('#FFFFFF')
- end
-
- it 'should return 404 if label does not exist' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label2',
- new_name: 'label3'
- expect(response.status).to eq(404)
- end
-
- it 'should return 400 if no label name given' do
- put api("/projects/#{project.id}/labels", user), new_name: 'label2'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('400 (Bad request) "name" not given')
- end
-
- it 'should return 400 if no new parameters given' do
- put api("/projects/#{project.id}/labels", user), name: 'label1'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Required parameters '\
- '"new_name" or "color" missing')
- end
-
- it 'should return 400 for invalid name' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label1',
- new_name: '?',
- color: '#FFFFFF'
- expect(response.status).to eq(400)
- expect(json_response['message']['title']).to eq(['is invalid'])
- end
-
- it 'should return 400 for invalid name' do
- put api("/projects/#{project.id}/labels", user),
- name: 'label1',
- color: '#FF'
- expect(response.status).to eq(400)
- expect(json_response['message']['color']).to eq(['is invalid'])
- end
-
- it 'should return 400 for too long color code' do
- post api("/projects/#{project.id}/labels", user),
- name: 'Foo',
- color: '#FFAAFFFF'
- expect(response.status).to eq(400)
- expect(json_response['message']['color']).to eq(['is invalid'])
- end
- end
-end
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
deleted file mode 100644
index 9e252441a4f417d4aeeeb280161fac89f2cf0e08..0000000000000000000000000000000000000000
--- a/spec/requests/api/merge_requests_spec.rb
+++ /dev/null
@@ -1,409 +0,0 @@
-require "spec_helper"
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let!(:project) {create(:project, creator_id: user.id, namespace: user.namespace) }
- let!(:merge_request) { create(:merge_request, :simple, author: user, assignee: user, source_project: project, target_project: project, title: "Test") }
- let!(:merge_request_closed) { create(:merge_request, state: "closed", author: user, assignee: user, source_project: project, target_project: project, title: "Closed test") }
- let!(:merge_request_merged) { create(:merge_request, state: "merged", author: user, assignee: user, source_project: project, target_project: project, title: "Merged test") }
- let!(:note) { create(:note_on_merge_request, author: user, project: project, noteable: merge_request, note: "a comment on a MR") }
- before {
- project.team << [user, :reporters]
- }
-
- describe "GET /projects/:id/merge_requests" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/projects/#{project.id}/merge_requests")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated" do
- it "should return an array of all merge_requests" do
- get api("/projects/#{project.id}/merge_requests", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.last['title']).to eq(merge_request.title)
- end
-
- it "should return an array of all merge_requests" do
- get api("/projects/#{project.id}/merge_requests?state", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.last['title']).to eq(merge_request.title)
- end
-
- it "should return an array of open merge_requests" do
- get api("/projects/#{project.id}/merge_requests?state=opened", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.last['title']).to eq(merge_request.title)
- end
-
- it "should return an array of closed merge_requests" do
- get api("/projects/#{project.id}/merge_requests?state=closed", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(2)
- expect(json_response.second['title']).to eq(merge_request_closed.title)
- expect(json_response.first['title']).to eq(merge_request_merged.title)
- end
-
- it "should return an array of merged merge_requests" do
- get api("/projects/#{project.id}/merge_requests?state=merged", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['title']).to eq(merge_request_merged.title)
- end
-
- context "with ordering" do
- before do
- @mr_later = mr_with_later_created_and_updated_at_time
- @mr_earlier = mr_with_earlier_created_and_updated_at_time
- end
-
- it "should return an array of merge_requests in ascending order" do
- get api("/projects/#{project.id}/merge_requests?sort=asc", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.last['id']).to eq(@mr_earlier.id)
- expect(json_response.first['id']).to eq(@mr_later.id)
- end
-
- it "should return an array of merge_requests in descending order" do
- get api("/projects/#{project.id}/merge_requests?sort=desc", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.first['id']).to eq(@mr_later.id)
- expect(json_response.last['id']).to eq(@mr_earlier.id)
- end
-
- it "should return an array of merge_requests ordered by updated_at" do
- get api("/projects/#{project.id}/merge_requests?order_by=updated_at", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.last['id']).to eq(@mr_earlier.id)
- expect(json_response.first['id']).to eq(@mr_later.id)
- end
-
- it "should return an array of merge_requests ordered by created_at" do
- get api("/projects/#{project.id}/merge_requests?sort=created_at", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(3)
- expect(json_response.last['id']).to eq(@mr_earlier.id)
- expect(json_response.first['id']).to eq(@mr_later.id)
- end
- end
- end
- end
-
- describe "GET /projects/:id/merge_request/:merge_request_id" do
- it "should return merge_request" do
- get api("/projects/#{project.id}/merge_request/#{merge_request.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq(merge_request.title)
- expect(json_response['iid']).to eq(merge_request.iid)
- end
-
- it "should return a 404 error if merge_request_id not found" do
- get api("/projects/#{project.id}/merge_request/999", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'GET /projects/:id/merge_request/:merge_request_id/changes' do
- it 'should return the change information of the merge_request' do
- get api("/projects/#{project.id}/merge_request/#{merge_request.id}/changes", user)
- expect(response.status).to eq 200
- expect(json_response['changes'].size).to eq(merge_request.diffs.size)
- end
-
- it 'returns a 404 when merge_request_id not found' do
- get api("/projects/#{project.id}/merge_request/999/changes", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "POST /projects/:id/merge_requests" do
- context 'between branches projects' do
- it "should return merge_request" do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'Test merge_request',
- source_branch: 'stable',
- target_branch: 'master',
- author: user,
- labels: 'label, label2'
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('Test merge_request')
- expect(json_response['labels']).to eq(['label', 'label2'])
- end
-
- it "should return 422 when source_branch equals target_branch" do
- post api("/projects/#{project.id}/merge_requests", user),
- title: "Test merge_request", source_branch: "master", target_branch: "master", author: user
- expect(response.status).to eq(422)
- end
-
- it "should return 400 when source_branch is missing" do
- post api("/projects/#{project.id}/merge_requests", user),
- title: "Test merge_request", target_branch: "master", author: user
- expect(response.status).to eq(400)
- end
-
- it "should return 400 when target_branch is missing" do
- post api("/projects/#{project.id}/merge_requests", user),
- title: "Test merge_request", source_branch: "stable", author: user
- expect(response.status).to eq(400)
- end
-
- it "should return 400 when title is missing" do
- post api("/projects/#{project.id}/merge_requests", user),
- target_branch: 'master', source_branch: 'stable'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 on invalid label names' do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'Test merge_request',
- source_branch: 'stable',
- target_branch: 'master',
- author: user,
- labels: 'label, ?'
- expect(response.status).to eq(400)
- expect(json_response['message']['labels']['?']['title']).to eq(
- ['is invalid']
- )
- end
-
- context 'with existing MR' do
- before do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'Test merge_request',
- source_branch: 'stable',
- target_branch: 'master',
- author: user
- @mr = MergeRequest.all.last
- end
-
- it 'should return 409 when MR already exists for source/target' do
- expect do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'New test merge_request',
- source_branch: 'stable',
- target_branch: 'master',
- author: user
- end.to change { MergeRequest.count }.by(0)
- expect(response.status).to eq(409)
- end
- end
- end
-
- context 'forked projects' do
- let!(:user2) { create(:user) }
- let!(:fork_project) { create(:project, forked_from_project: project, namespace: user2.namespace, creator_id: user2.id) }
- let!(:unrelated_project) { create(:project, namespace: create(:user).namespace, creator_id: user2.id) }
-
- before :each do |each|
- fork_project.team << [user2, :reporters]
- end
-
- it "should return merge_request" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', source_branch: "stable", target_branch: "master", author: user2, target_project_id: project.id, description: 'Test description for Test merge_request'
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('Test merge_request')
- expect(json_response['description']).to eq('Test description for Test merge_request')
- end
-
- it "should not return 422 when source_branch equals target_branch" do
- expect(project.id).not_to eq(fork_project.id)
- expect(fork_project.forked?).to be_truthy
- expect(fork_project.forked_from_project).to eq(project)
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', source_branch: "master", target_branch: "master", author: user2, target_project_id: project.id
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('Test merge_request')
- end
-
- it "should return 400 when source_branch is missing" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', target_branch: "master", author: user2, target_project_id: project.id
- expect(response.status).to eq(400)
- end
-
- it "should return 400 when target_branch is missing" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', target_branch: "master", author: user2, target_project_id: project.id
- expect(response.status).to eq(400)
- end
-
- it "should return 400 when title is missing" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- target_branch: 'master', source_branch: 'stable', author: user2, target_project_id: project.id
- expect(response.status).to eq(400)
- end
-
- context 'when target_branch is specified' do
- it 'should return 422 if not a forked project' do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'Test merge_request',
- target_branch: 'master',
- source_branch: 'stable',
- author: user,
- target_project_id: fork_project.id
- expect(response.status).to eq(422)
- end
-
- it 'should return 422 if targeting a different fork' do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request',
- target_branch: 'master',
- source_branch: 'stable',
- author: user2,
- target_project_id: unrelated_project.id
- expect(response.status).to eq(422)
- end
- end
-
- it "should return 201 when target_branch is specified and for the same project" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', target_branch: 'master', source_branch: 'stable', author: user2, target_project_id: fork_project.id
- expect(response.status).to eq(201)
- end
- end
- end
-
- describe "PUT /projects/:id/merge_request/:merge_request_id to close MR" do
- it "should return merge_request" do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user), state_event: "close"
- expect(response.status).to eq(200)
- expect(json_response['state']).to eq('closed')
- end
- end
-
- describe "PUT /projects/:id/merge_request/:merge_request_id/merge" do
- it "should return merge_request in case of success" do
- MergeRequest.any_instance.stub(can_be_merged?: true, automerge!: true)
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user)
- expect(response.status).to eq(200)
- end
-
- it "should return 405 if branch can't be merged" do
- MergeRequest.any_instance.stub(can_be_merged?: false)
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user)
- expect(response.status).to eq(405)
- expect(json_response['message']).to eq('Branch cannot be merged')
- end
-
- it "should return 405 if merge_request is not open" do
- merge_request.close
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user)
- expect(response.status).to eq(405)
- expect(json_response['message']).to eq('405 Method Not Allowed')
- end
-
- it "should return 401 if user has no permissions to merge" do
- user2 = create(:user)
- project.team << [user2, :reporter]
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user2)
- expect(response.status).to eq(401)
- expect(json_response['message']).to eq('401 Unauthorized')
- end
- end
-
- describe "PUT /projects/:id/merge_request/:merge_request_id" do
- it "should return merge_request" do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user), title: "New title"
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq('New title')
- end
-
- it "should return merge_request" do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user), description: "New description"
- expect(response.status).to eq(200)
- expect(json_response['description']).to eq('New description')
- end
-
- it "should return 422 when source_branch and target_branch are renamed the same" do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user),
- source_branch: "master", target_branch: "master"
- expect(response.status).to eq(422)
- end
-
- it "should return merge_request with renamed target_branch" do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user), target_branch: "wiki"
- expect(response.status).to eq(200)
- expect(json_response['target_branch']).to eq('wiki')
- end
-
- it 'should return 400 on invalid label names' do
- put api("/projects/#{project.id}/merge_request/#{merge_request.id}",
- user),
- title: 'new issue',
- labels: 'label, ?'
- expect(response.status).to eq(400)
- expect(json_response['message']['labels']['?']['title']).to eq(['is invalid'])
- end
- end
-
- describe "POST /projects/:id/merge_request/:merge_request_id/comments" do
- it "should return comment" do
- post api("/projects/#{project.id}/merge_request/#{merge_request.id}/comments", user), note: "My comment"
- expect(response.status).to eq(201)
- expect(json_response['note']).to eq('My comment')
- end
-
- it "should return 400 if note is missing" do
- post api("/projects/#{project.id}/merge_request/#{merge_request.id}/comments", user)
- expect(response.status).to eq(400)
- end
-
- it "should return 404 if note is attached to non existent merge request" do
- post api("/projects/#{project.id}/merge_request/404/comments", user),
- note: 'My comment'
- expect(response.status).to eq(404)
- end
- end
-
- describe "GET :id/merge_request/:merge_request_id/comments" do
- it "should return merge_request comments" do
- get api("/projects/#{project.id}/merge_request/#{merge_request.id}/comments", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- expect(json_response.first['note']).to eq("a comment on a MR")
- expect(json_response.first['author']['id']).to eq(user.id)
- end
-
- it "should return a 404 error if merge_request_id not found" do
- get api("/projects/#{project.id}/merge_request/999/comments", user)
- expect(response.status).to eq(404)
- end
- end
-
- def mr_with_later_created_and_updated_at_time
- merge_request
- merge_request.created_at += 1.hour
- merge_request.updated_at += 30.minutes
- merge_request.save
- merge_request
- end
-
- def mr_with_earlier_created_and_updated_at_time
- merge_request_closed
- merge_request_closed.created_at -= 1.hour
- merge_request_closed.updated_at -= 30.minutes
- merge_request_closed.save
- merge_request_closed
- end
-end
diff --git a/spec/requests/api/milestones_spec.rb b/spec/requests/api/milestones_spec.rb
deleted file mode 100644
index effb0723476e843bc0e66101baf7e78480bf5b2e..0000000000000000000000000000000000000000
--- a/spec/requests/api/milestones_spec.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let!(:project) { create(:project, namespace: user.namespace ) }
- let!(:milestone) { create(:milestone, project: project) }
-
- before { project.team << [user, :developer] }
-
- describe 'GET /projects/:id/milestones' do
- it 'should return project milestones' do
- get api("/projects/#{project.id}/milestones", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(milestone.title)
- end
-
- it 'should return a 401 error if user not authenticated' do
- get api("/projects/#{project.id}/milestones")
- expect(response.status).to eq(401)
- end
- end
-
- describe 'GET /projects/:id/milestones/:milestone_id' do
- it 'should return a project milestone by id' do
- get api("/projects/#{project.id}/milestones/#{milestone.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq(milestone.title)
- expect(json_response['iid']).to eq(milestone.iid)
- end
-
- it 'should return 401 error if user not authenticated' do
- get api("/projects/#{project.id}/milestones/#{milestone.id}")
- expect(response.status).to eq(401)
- end
-
- it 'should return a 404 error if milestone id not found' do
- get api("/projects/#{project.id}/milestones/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'POST /projects/:id/milestones' do
- it 'should create a new project milestone' do
- post api("/projects/#{project.id}/milestones", user), title: 'new milestone'
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('new milestone')
- expect(json_response['description']).to be_nil
- end
-
- it 'should create a new project milestone with description and due date' do
- post api("/projects/#{project.id}/milestones", user),
- title: 'new milestone', description: 'release', due_date: '2013-03-02'
- expect(response.status).to eq(201)
- expect(json_response['description']).to eq('release')
- expect(json_response['due_date']).to eq('2013-03-02')
- end
-
- it 'should return a 400 error if title is missing' do
- post api("/projects/#{project.id}/milestones", user)
- expect(response.status).to eq(400)
- end
- end
-
- describe 'PUT /projects/:id/milestones/:milestone_id' do
- it 'should update a project milestone' do
- put api("/projects/#{project.id}/milestones/#{milestone.id}", user),
- title: 'updated title'
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq('updated title')
- end
-
- it 'should return a 404 error if milestone id not found' do
- put api("/projects/#{project.id}/milestones/1234", user),
- title: 'updated title'
- expect(response.status).to eq(404)
- end
- end
-
- describe 'PUT /projects/:id/milestones/:milestone_id to close milestone' do
- it 'should update a project milestone' do
- put api("/projects/#{project.id}/milestones/#{milestone.id}", user),
- state_event: 'close'
- expect(response.status).to eq(200)
-
- expect(json_response['state']).to eq('closed')
- end
- end
-
- describe 'PUT /projects/:id/milestones/:milestone_id to test observer on close' do
- it 'should create an activity event when an milestone is closed' do
- expect(Event).to receive(:create)
-
- put api("/projects/#{project.id}/milestones/#{milestone.id}", user),
- state_event: 'close'
- end
- end
-
- describe 'GET /projects/:id/milestones/:milestone_id/issues' do
- before do
- milestone.issues << create(:issue)
- end
- it 'should return project issues for a particular milestone' do
- get api("/projects/#{project.id}/milestones/#{milestone.id}/issues", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['milestone']['title']).to eq(milestone.title)
- end
-
- it 'should return a 401 error if user not authenticated' do
- get api("/projects/#{project.id}/milestones/#{milestone.id}/issues")
- expect(response.status).to eq(401)
- end
- end
-end
diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb
deleted file mode 100644
index 6ddaaa0a6dde9603476184e91a9b5814ccd0b34f..0000000000000000000000000000000000000000
--- a/spec/requests/api/namespaces_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:admin) { create(:admin) }
- let!(:group1) { create(:group) }
- let!(:group2) { create(:group) }
-
- describe "GET /namespaces" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/namespaces")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated as admin" do
- it "admin: should return an array of all namespaces" do
- get api("/namespaces", admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
-
- expect(json_response.length).to eq(Namespace.count)
- end
- end
- end
-end
diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb
deleted file mode 100644
index 8b177af4689b09b63ff434c891d7d4feebdfa358..0000000000000000000000000000000000000000
--- a/spec/requests/api/notes_spec.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let!(:project) { create(:project, namespace: user.namespace ) }
- let!(:issue) { create(:issue, project: project, author: user) }
- let!(:merge_request) { create(:merge_request, source_project: project, target_project: project, author: user) }
- let!(:snippet) { create(:project_snippet, project: project, author: user) }
- let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) }
- let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) }
- let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) }
- before { project.team << [user, :reporter] }
-
- describe "GET /projects/:id/noteable/:noteable_id/notes" do
- context "when noteable is an Issue" do
- it "should return an array of issue notes" do
- get api("/projects/#{project.id}/issues/#{issue.id}/notes", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['body']).to eq(issue_note.note)
- end
-
- it "should return a 404 error when issue id not found" do
- get api("/projects/#{project.id}/issues/123/notes", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "when noteable is a Snippet" do
- it "should return an array of snippet notes" do
- get api("/projects/#{project.id}/snippets/#{snippet.id}/notes", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['body']).to eq(snippet_note.note)
- end
-
- it "should return a 404 error when snippet id not found" do
- get api("/projects/#{project.id}/snippets/42/notes", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "when noteable is a Merge Request" do
- it "should return an array of merge_requests notes" do
- get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/notes", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['body']).to eq(merge_request_note.note)
- end
-
- it "should return a 404 error if merge request id not found" do
- get api("/projects/#{project.id}/merge_requests/4444/notes", user)
- expect(response.status).to eq(404)
- end
- end
- end
-
- describe "GET /projects/:id/noteable/:noteable_id/notes/:note_id" do
- context "when noteable is an Issue" do
- it "should return an issue note by id" do
- get api("/projects/#{project.id}/issues/#{issue.id}/notes/#{issue_note.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['body']).to eq(issue_note.note)
- end
-
- it "should return a 404 error if issue note not found" do
- get api("/projects/#{project.id}/issues/#{issue.id}/notes/123", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "when noteable is a Snippet" do
- it "should return a snippet note by id" do
- get api("/projects/#{project.id}/snippets/#{snippet.id}/notes/#{snippet_note.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['body']).to eq(snippet_note.note)
- end
-
- it "should return a 404 error if snippet note not found" do
- get api("/projects/#{project.id}/snippets/#{snippet.id}/notes/123", user)
- expect(response.status).to eq(404)
- end
- end
- end
-
- describe "POST /projects/:id/noteable/:noteable_id/notes" do
- context "when noteable is an Issue" do
- it "should create a new issue note" do
- post api("/projects/#{project.id}/issues/#{issue.id}/notes", user), body: 'hi!'
- expect(response.status).to eq(201)
- expect(json_response['body']).to eq('hi!')
- expect(json_response['author']['username']).to eq(user.username)
- end
-
- it "should return a 400 bad request error if body not given" do
- post api("/projects/#{project.id}/issues/#{issue.id}/notes", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 401 unauthorized error if user not authenticated" do
- post api("/projects/#{project.id}/issues/#{issue.id}/notes"), body: 'hi!'
- expect(response.status).to eq(401)
- end
- end
-
- context "when noteable is a Snippet" do
- it "should create a new snippet note" do
- post api("/projects/#{project.id}/snippets/#{snippet.id}/notes", user), body: 'hi!'
- expect(response.status).to eq(201)
- expect(json_response['body']).to eq('hi!')
- expect(json_response['author']['username']).to eq(user.username)
- end
-
- it "should return a 400 bad request error if body not given" do
- post api("/projects/#{project.id}/snippets/#{snippet.id}/notes", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 401 unauthorized error if user not authenticated" do
- post api("/projects/#{project.id}/snippets/#{snippet.id}/notes"), body: 'hi!'
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe "POST /projects/:id/noteable/:noteable_id/notes to test observer on create" do
- it "should create an activity event when an issue note is created" do
- expect(Event).to receive(:create)
-
- post api("/projects/#{project.id}/issues/#{issue.id}/notes", user), body: 'hi!'
- end
- end
-
- describe 'PUT /projects/:id/noteable/:noteable_id/notes/:note_id' do
- context 'when noteable is an Issue' do
- it 'should return modified note' do
- put api("/projects/#{project.id}/issues/#{issue.id}/"\
- "notes/#{issue_note.id}", user), body: 'Hello!'
- expect(response.status).to eq(200)
- expect(json_response['body']).to eq('Hello!')
- end
-
- it 'should return a 404 error when note id not found' do
- put api("/projects/#{project.id}/issues/#{issue.id}/notes/123", user),
- body: 'Hello!'
- expect(response.status).to eq(404)
- end
-
- it 'should return a 400 bad request error if body not given' do
- put api("/projects/#{project.id}/issues/#{issue.id}/"\
- "notes/#{issue_note.id}", user)
- expect(response.status).to eq(400)
- end
- end
-
- context 'when noteable is a Snippet' do
- it 'should return modified note' do
- put api("/projects/#{project.id}/snippets/#{snippet.id}/"\
- "notes/#{snippet_note.id}", user), body: 'Hello!'
- expect(response.status).to eq(200)
- expect(json_response['body']).to eq('Hello!')
- end
-
- it 'should return a 404 error when note id not found' do
- put api("/projects/#{project.id}/snippets/#{snippet.id}/"\
- "notes/123", user), body: "Hello!"
- expect(response.status).to eq(404)
- end
- end
-
- context 'when noteable is a Merge Request' do
- it 'should return modified note' do
- put api("/projects/#{project.id}/merge_requests/#{merge_request.id}/"\
- "notes/#{merge_request_note.id}", user), body: 'Hello!'
- expect(response.status).to eq(200)
- expect(json_response['body']).to eq('Hello!')
- end
-
- it 'should return a 404 error when note id not found' do
- put api("/projects/#{project.id}/merge_requests/#{merge_request.id}/"\
- "notes/123", user), body: "Hello!"
- expect(response.status).to eq(404)
- end
- end
- end
-
-end
diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb
deleted file mode 100644
index 81fe68de662c94a01a4d8090da89a50268262178..0000000000000000000000000000000000000000
--- a/spec/requests/api/project_hooks_spec.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'spec_helper'
-
-describe API::API, 'ProjectHooks', api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:user3) { create(:user) }
- let!(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
- let!(:hook) { create(:project_hook, project: project, url: "http://example.com") }
-
- before do
- project.team << [user, :master]
- project.team << [user3, :developer]
- end
-
- describe "GET /projects/:id/hooks" do
- context "authorized user" do
- it "should return project hooks" do
- get api("/projects/#{project.id}/hooks", user)
- expect(response.status).to eq(200)
-
- expect(json_response).to be_an Array
- expect(json_response.count).to eq(1)
- expect(json_response.first['url']).to eq("http://example.com")
- end
- end
-
- context "unauthorized user" do
- it "should not access project hooks" do
- get api("/projects/#{project.id}/hooks", user3)
- expect(response.status).to eq(403)
- end
- end
- end
-
- describe "GET /projects/:id/hooks/:hook_id" do
- context "authorized user" do
- it "should return a project hook" do
- get api("/projects/#{project.id}/hooks/#{hook.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['url']).to eq(hook.url)
- end
-
- it "should return a 404 error if hook id is not available" do
- get api("/projects/#{project.id}/hooks/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- context "unauthorized user" do
- it "should not access an existing hook" do
- get api("/projects/#{project.id}/hooks/#{hook.id}", user3)
- expect(response.status).to eq(403)
- end
- end
-
- it "should return a 404 error if hook id is not available" do
- get api("/projects/#{project.id}/hooks/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "POST /projects/:id/hooks" do
- it "should add hook to project" do
- expect {
- post api("/projects/#{project.id}/hooks", user),
- url: "http://example.com", issues_events: true
- }.to change {project.hooks.count}.by(1)
- expect(response.status).to eq(201)
- end
-
- it "should return a 400 error if url not given" do
- post api("/projects/#{project.id}/hooks", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 422 error if url not valid" do
- post api("/projects/#{project.id}/hooks", user), "url" => "ftp://example.com"
- expect(response.status).to eq(422)
- end
- end
-
- describe "PUT /projects/:id/hooks/:hook_id" do
- it "should update an existing project hook" do
- put api("/projects/#{project.id}/hooks/#{hook.id}", user),
- url: 'http://example.org', push_events: false
- expect(response.status).to eq(200)
- expect(json_response['url']).to eq('http://example.org')
- end
-
- it "should return 404 error if hook id not found" do
- put api("/projects/#{project.id}/hooks/1234", user), url: 'http://example.org'
- expect(response.status).to eq(404)
- end
-
- it "should return 400 error if url is not given" do
- put api("/projects/#{project.id}/hooks/#{hook.id}", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 422 error if url is not valid" do
- put api("/projects/#{project.id}/hooks/#{hook.id}", user), url: 'ftp://example.com'
- expect(response.status).to eq(422)
- end
- end
-
- describe "DELETE /projects/:id/hooks/:hook_id" do
- it "should delete hook from project" do
- expect {
- delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
- }.to change {project.hooks.count}.by(-1)
- expect(response.status).to eq(200)
- end
-
- it "should return success when deleting hook" do
- delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
- expect(response.status).to eq(200)
- end
-
- it "should return success when deleting non existent hook" do
- delete api("/projects/#{project.id}/hooks/42", user)
- expect(response.status).to eq(200)
- end
-
- it "should return a 405 error if hook id not given" do
- delete api("/projects/#{project.id}/hooks", user)
- expect(response.status).to eq(405)
- end
- end
-end
diff --git a/spec/requests/api/project_members_spec.rb b/spec/requests/api/project_members_spec.rb
deleted file mode 100644
index 8419a364ed115501b4d512cd73878c5766f0bc40..0000000000000000000000000000000000000000
--- a/spec/requests/api/project_members_spec.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:user3) { create(:user) }
- let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
- let(:project_member) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
- let(:project_member2) { create(:project_member, user: user3, project: project, access_level: ProjectMember::DEVELOPER) }
-
- describe "GET /projects/:id/members" do
- before { project_member }
- before { project_member2 }
-
- it "should return project team members" do
- get api("/projects/#{project.id}/members", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.count).to eq(2)
- expect(json_response.map { |u| u['username'] }).to include user.username
- end
-
- it "finds team members with query string" do
- get api("/projects/#{project.id}/members", user), query: user.username
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.count).to eq(1)
- expect(json_response.first['username']).to eq(user.username)
- end
-
- it "should return a 404 error if id not found" do
- get api("/projects/9999/members", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "GET /projects/:id/members/:user_id" do
- before { project_member }
-
- it "should return project team member" do
- get api("/projects/#{project.id}/members/#{user.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['username']).to eq(user.username)
- expect(json_response['access_level']).to eq(ProjectMember::MASTER)
- end
-
- it "should return a 404 error if user id not found" do
- get api("/projects/#{project.id}/members/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe "POST /projects/:id/members" do
- it "should add user to project team" do
- expect {
- post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: ProjectMember::DEVELOPER
- }.to change { ProjectMember.count }.by(1)
-
- expect(response.status).to eq(201)
- expect(json_response['username']).to eq(user2.username)
- expect(json_response['access_level']).to eq(ProjectMember::DEVELOPER)
- end
-
- it "should return a 201 status if user is already project member" do
- post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: ProjectMember::DEVELOPER
- expect {
- post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: ProjectMember::DEVELOPER
- }.not_to change { ProjectMember.count }
-
- expect(response.status).to eq(201)
- expect(json_response['username']).to eq(user2.username)
- expect(json_response['access_level']).to eq(ProjectMember::DEVELOPER)
- end
-
- it "should return a 400 error when user id is not given" do
- post api("/projects/#{project.id}/members", user), access_level: ProjectMember::MASTER
- expect(response.status).to eq(400)
- end
-
- it "should return a 400 error when access level is not given" do
- post api("/projects/#{project.id}/members", user), user_id: user2.id
- expect(response.status).to eq(400)
- end
-
- it "should return a 422 error when access level is not known" do
- post api("/projects/#{project.id}/members", user), user_id: user2.id, access_level: 1234
- expect(response.status).to eq(422)
- end
- end
-
- describe "PUT /projects/:id/members/:user_id" do
- before { project_member2 }
-
- it "should update project team member" do
- put api("/projects/#{project.id}/members/#{user3.id}", user), access_level: ProjectMember::MASTER
- expect(response.status).to eq(200)
- expect(json_response['username']).to eq(user3.username)
- expect(json_response['access_level']).to eq(ProjectMember::MASTER)
- end
-
- it "should return a 404 error if user_id is not found" do
- put api("/projects/#{project.id}/members/1234", user), access_level: ProjectMember::MASTER
- expect(response.status).to eq(404)
- end
-
- it "should return a 400 error when access level is not given" do
- put api("/projects/#{project.id}/members/#{user3.id}", user)
- expect(response.status).to eq(400)
- end
-
- it "should return a 422 error when access level is not known" do
- put api("/projects/#{project.id}/members/#{user3.id}", user), access_level: 123
- expect(response.status).to eq(422)
- end
- end
-
- describe "DELETE /projects/:id/members/:user_id" do
- before { project_member }
- before { project_member2 }
-
- it "should remove user from project team" do
- expect {
- delete api("/projects/#{project.id}/members/#{user3.id}", user)
- }.to change { ProjectMember.count }.by(-1)
- end
-
- it "should return 200 if team member is not part of a project" do
- delete api("/projects/#{project.id}/members/#{user3.id}", user)
- expect {
- delete api("/projects/#{project.id}/members/#{user3.id}", user)
- }.to_not change { ProjectMember.count }
- end
-
- it "should return 200 if team member already removed" do
- delete api("/projects/#{project.id}/members/#{user3.id}", user)
- delete api("/projects/#{project.id}/members/#{user3.id}", user)
- expect(response.status).to eq(200)
- end
-
- it "should return 200 OK when the user was not member" do
- expect {
- delete api("/projects/#{project.id}/members/1000000", user)
- }.to change { ProjectMember.count }.by(0)
- expect(response.status).to eq(200)
- expect(json_response['message']).to eq("Access revoked")
- expect(json_response['id']).to eq(1000000)
- end
- end
-end
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
deleted file mode 100644
index cc387378d3a824bd464a484b3fb147cf86716ab8..0000000000000000000000000000000000000000
--- a/spec/requests/api/projects_spec.rb
+++ /dev/null
@@ -1,825 +0,0 @@
-# -*- coding: utf-8 -*-
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
- include Gitlab::CurrentSettings
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:user3) { create(:user) }
- let(:admin) { create(:admin) }
- let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
- let(:project2) { create(:project, path: 'project2', creator_id: user.id, namespace: user.namespace) }
- let(:project3) { create(:project, path: 'project3', creator_id: user.id, namespace: user.namespace) }
- let(:snippet) { create(:project_snippet, author: user, project: project, title: 'example') }
- let(:project_member) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
- let(:project_member2) { create(:project_member, user: user3, project: project, access_level: ProjectMember::DEVELOPER) }
- let(:user4) { create(:user) }
- let(:project3) do
- create(:project,
- name: 'second_project',
- path: 'second_project',
- creator_id: user.id,
- namespace: user.namespace,
- merge_requests_enabled: false,
- issues_enabled: false, wiki_enabled: false,
- snippets_enabled: false, visibility_level: 0)
- end
- let(:project_member3) do
- create(:project_member,
- user: user4,
- project: project3,
- access_level: ProjectMember::MASTER)
- end
- let(:project4) do
- create(:project,
- name: 'third_project',
- path: 'third_project',
- creator_id: user4.id,
- namespace: user4.namespace)
- end
-
- describe 'GET /projects' do
- before { project }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- get api('/projects')
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated' do
- it 'should return an array of projects' do
- get api('/projects', user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['name']).to eq(project.name)
- expect(json_response.first['owner']['username']).to eq(user.username)
- end
-
- it 'should include the project labels as the tag_list' do
- get api('/projects', user)
- response.status.should == 200
- json_response.should be_an Array
- json_response.first.keys.should include('tag_list')
- end
-
- context 'and using search' do
- it 'should return searched project' do
- get api('/projects', user), { search: project.name }
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.length).to eq(1)
- end
- end
-
- context 'and using sorting' do
- before do
- project2
- project3
- end
-
- it 'should return the correct order when sorted by id' do
- get api('/projects', user), { order_by: 'id', sort: 'desc'}
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['id']).to eq(project3.id)
- end
- end
- end
- end
-
- describe 'GET /projects/all' do
- before { project }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- get api('/projects/all')
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated as regular user' do
- it 'should return authentication error' do
- get api('/projects/all', user)
- expect(response.status).to eq(403)
- end
- end
-
- context 'when authenticated as admin' do
- it 'should return an array of all projects' do
- get api('/projects/all', admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- project_name = project.name
-
- expect(json_response.detect {
- |project| project['name'] == project_name
- }['name']).to eq(project_name)
-
- expect(json_response.detect {
- |project| project['owner']['username'] == user.username
- }['owner']['username']).to eq(user.username)
- end
- end
- end
-
- describe 'POST /projects' do
- context 'maximum number of projects reached' do
- it 'should not create new project and respond with 403' do
- allow_any_instance_of(User).to receive(:projects_limit_left).and_return(0)
- expect {
- post api('/projects', user2), name: 'foo'
- }.to change {Project.count}.by(0)
- expect(response.status).to eq(403)
- end
- end
-
- it 'should create new project without path and return 201' do
- expect { post api('/projects', user), name: 'foo' }.
- to change { Project.count }.by(1)
- expect(response.status).to eq(201)
- end
-
- it 'should create last project before reaching project limit' do
- allow_any_instance_of(User).to receive(:projects_limit_left).and_return(1)
- post api('/projects', user2), name: 'foo'
- expect(response.status).to eq(201)
- end
-
- it 'should not create new project without name and return 400' do
- expect { post api('/projects', user) }.to_not change { Project.count }
- expect(response.status).to eq(400)
- end
-
- it "should assign attributes to project" do
- project = attributes_for(:project, {
- path: 'camelCasePath',
- description: Faker::Lorem.sentence,
- issues_enabled: false,
- merge_requests_enabled: false,
- wiki_enabled: false
- })
-
- post api('/projects', user), project
-
- project.each_pair do |k,v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should set a project as public' do
- project = attributes_for(:project, :public)
- post api('/projects', user), project
- expect(json_response['public']).to be_truthy
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'should set a project as public using :public' do
- project = attributes_for(:project, { public: true })
- post api('/projects', user), project
- expect(json_response['public']).to be_truthy
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'should set a project as internal' do
- project = attributes_for(:project, :internal)
- post api('/projects', user), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::INTERNAL)
- end
-
- it 'should set a project as internal overriding :public' do
- project = attributes_for(:project, :internal, { public: true })
- post api('/projects', user), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::INTERNAL)
- end
-
- it 'should set a project as private' do
- project = attributes_for(:project, :private)
- post api('/projects', user), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-
- it 'should set a project as private using :public' do
- project = attributes_for(:project, { public: false })
- post api('/projects', user), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-
- context 'when a visibility level is restricted' do
- before do
- @project = attributes_for(:project, { public: true })
- allow_any_instance_of(ApplicationSetting).to(
- receive(:restricted_visibility_levels).and_return([20])
- )
- end
-
- it 'should not allow a non-admin to use a restricted visibility level' do
- post api('/projects', user), @project
- expect(response.status).to eq(400)
- expect(json_response['message']['visibility_level'].first).to(
- match('restricted by your GitLab administrator')
- )
- end
-
- it 'should allow an admin to override restricted visibility settings' do
- post api('/projects', admin), @project
- expect(json_response['public']).to be_truthy
- expect(json_response['visibility_level']).to(
- eq(Gitlab::VisibilityLevel::PUBLIC)
- )
- end
- end
- end
-
- describe 'POST /projects/user/:id' do
- before { project }
- before { admin }
-
- it 'should create new project without path and return 201' do
- expect { post api("/projects/user/#{user.id}", admin), name: 'foo' }.to change {Project.count}.by(1)
- expect(response.status).to eq(201)
- end
-
- it 'should respond with 400 on failure and not project' do
- expect { post api("/projects/user/#{user.id}", admin) }.
- to_not change { Project.count }
-
- expect(response.status).to eq(400)
- expect(json_response['message']['name']).to eq([
- 'can\'t be blank',
- 'is too short (minimum is 0 characters)',
- Gitlab::Regex.project_name_regex_message
- ])
- expect(json_response['message']['path']).to eq([
- 'can\'t be blank',
- 'is too short (minimum is 0 characters)',
- Gitlab::Regex.send(:project_path_regex_message)
- ])
- end
-
- it 'should assign attributes to project' do
- project = attributes_for(:project, {
- description: Faker::Lorem.sentence,
- issues_enabled: false,
- merge_requests_enabled: false,
- wiki_enabled: false
- })
-
- post api("/projects/user/#{user.id}", admin), project
-
- project.each_pair do |k,v|
- next if k == :path
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should set a project as public' do
- project = attributes_for(:project, :public)
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_truthy
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'should set a project as public using :public' do
- project = attributes_for(:project, { public: true })
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_truthy
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'should set a project as internal' do
- project = attributes_for(:project, :internal)
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::INTERNAL)
- end
-
- it 'should set a project as internal overriding :public' do
- project = attributes_for(:project, :internal, { public: true })
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::INTERNAL)
- end
-
- it 'should set a project as private' do
- project = attributes_for(:project, :private)
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
-
- it 'should set a project as private using :public' do
- project = attributes_for(:project, { public: false })
- post api("/projects/user/#{user.id}", admin), project
- expect(json_response['public']).to be_falsey
- expect(json_response['visibility_level']).to eq(Gitlab::VisibilityLevel::PRIVATE)
- end
- end
-
- describe 'GET /projects/:id' do
- before { project }
- before { project_member }
-
- it 'should return a project by id' do
- get api("/projects/#{project.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['name']).to eq(project.name)
- expect(json_response['owner']['username']).to eq(user.username)
- end
-
- it 'should return a project by path name' do
- get api("/projects/#{project.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['name']).to eq(project.name)
- end
-
- it 'should return a 404 error if not found' do
- get api('/projects/42', user)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Project Not Found')
- end
-
- it 'should return a 404 error if user is not a member' do
- other_user = create(:user)
- get api("/projects/#{project.id}", other_user)
- expect(response.status).to eq(404)
- end
-
- describe 'permissions' do
- context 'personal project' do
- it 'Sets project access and returns 200' do
- project.team << [user, :master]
- get api("/projects/#{project.id}", user)
-
- expect(response.status).to eq(200)
- expect(json_response['permissions']['project_access']['access_level']).
- to eq(Gitlab::Access::MASTER)
- expect(json_response['permissions']['group_access']).to be_nil
- end
- end
-
- context 'group project' do
- it 'should set the owner and return 200' do
- project2 = create(:project, group: create(:group))
- project2.group.add_owner(user)
- get api("/projects/#{project2.id}", user)
-
- expect(response.status).to eq(200)
- expect(json_response['permissions']['project_access']).to be_nil
- expect(json_response['permissions']['group_access']['access_level']).
- to eq(Gitlab::Access::OWNER)
- end
- end
- end
- end
-
- describe 'GET /projects/:id/events' do
- before { project_member2 }
-
- it 'should return a project events' do
- get api("/projects/#{project.id}/events", user)
- expect(response.status).to eq(200)
- json_event = json_response.first
-
- expect(json_event['action_name']).to eq('joined')
- expect(json_event['project_id'].to_i).to eq(project.id)
- expect(json_event['author_username']).to eq(user3.username)
- end
-
- it 'should return a 404 error if not found' do
- get api('/projects/42/events', user)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Project Not Found')
- end
-
- it 'should return a 404 error if user is not a member' do
- other_user = create(:user)
- get api("/projects/#{project.id}/events", other_user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'GET /projects/:id/snippets' do
- before { snippet }
-
- it 'should return an array of project snippets' do
- get api("/projects/#{project.id}/snippets", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(snippet.title)
- end
- end
-
- describe 'GET /projects/:id/snippets/:snippet_id' do
- it 'should return a project snippet' do
- get api("/projects/#{project.id}/snippets/#{snippet.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq(snippet.title)
- end
-
- it 'should return a 404 error if snippet id not found' do
- get api("/projects/#{project.id}/snippets/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'POST /projects/:id/snippets' do
- it 'should create a new project snippet' do
- post api("/projects/#{project.id}/snippets", user),
- title: 'api test', file_name: 'sample.rb', code: 'test',
- visibility_level: '0'
- expect(response.status).to eq(201)
- expect(json_response['title']).to eq('api test')
- end
-
- it 'should return a 400 error if invalid snippet is given' do
- post api("/projects/#{project.id}/snippets", user)
- expect(status).to eq(400)
- end
- end
-
- describe 'PUT /projects/:id/snippets/:shippet_id' do
- it 'should update an existing project snippet' do
- put api("/projects/#{project.id}/snippets/#{snippet.id}", user),
- code: 'updated code'
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq('example')
- expect(snippet.reload.content).to eq('updated code')
- end
-
- it 'should update an existing project snippet with new title' do
- put api("/projects/#{project.id}/snippets/#{snippet.id}", user),
- title: 'other api test'
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq('other api test')
- end
- end
-
- describe 'DELETE /projects/:id/snippets/:snippet_id' do
- before { snippet }
-
- it 'should delete existing project snippet' do
- expect {
- delete api("/projects/#{project.id}/snippets/#{snippet.id}", user)
- }.to change { Snippet.count }.by(-1)
- expect(response.status).to eq(200)
- end
-
- it 'should return 404 when deleting unknown snippet id' do
- delete api("/projects/#{project.id}/snippets/1234", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'GET /projects/:id/snippets/:snippet_id/raw' do
- it 'should get a raw project snippet' do
- get api("/projects/#{project.id}/snippets/#{snippet.id}/raw", user)
- expect(response.status).to eq(200)
- end
-
- it 'should return a 404 error if raw project snippet not found' do
- get api("/projects/#{project.id}/snippets/5555/raw", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe :deploy_keys do
- let(:deploy_keys_project) { create(:deploy_keys_project, project: project) }
- let(:deploy_key) { deploy_keys_project.deploy_key }
-
- describe 'GET /projects/:id/keys' do
- before { deploy_key }
-
- it 'should return array of ssh keys' do
- get api("/projects/#{project.id}/keys", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(deploy_key.title)
- end
- end
-
- describe 'GET /projects/:id/keys/:key_id' do
- it 'should return a single key' do
- get api("/projects/#{project.id}/keys/#{deploy_key.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['title']).to eq(deploy_key.title)
- end
-
- it 'should return 404 Not Found with invalid ID' do
- get api("/projects/#{project.id}/keys/404", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'POST /projects/:id/keys' do
- it 'should not create an invalid ssh key' do
- post api("/projects/#{project.id}/keys", user), { title: 'invalid key' }
- expect(response.status).to eq(400)
- expect(json_response['message']['key']).to eq([
- 'can\'t be blank',
- 'is too short (minimum is 0 characters)',
- 'is invalid'
- ])
- end
-
- it 'should not create a key without title' do
- post api("/projects/#{project.id}/keys", user), key: 'some key'
- expect(response.status).to eq(400)
- expect(json_response['message']['title']).to eq([
- 'can\'t be blank',
- 'is too short (minimum is 0 characters)'
- ])
- end
-
- it 'should create new ssh key' do
- key_attrs = attributes_for :key
- expect {
- post api("/projects/#{project.id}/keys", user), key_attrs
- }.to change{ project.deploy_keys.count }.by(1)
- end
- end
-
- describe 'DELETE /projects/:id/keys/:key_id' do
- before { deploy_key }
-
- it 'should delete existing key' do
- expect {
- delete api("/projects/#{project.id}/keys/#{deploy_key.id}", user)
- }.to change{ project.deploy_keys.count }.by(-1)
- end
-
- it 'should return 404 Not Found with invalid ID' do
- delete api("/projects/#{project.id}/keys/404", user)
- expect(response.status).to eq(404)
- end
- end
- end
-
- describe :fork_admin do
- let(:project_fork_target) { create(:project) }
- let(:project_fork_source) { create(:project, :public) }
-
- describe 'POST /projects/:id/fork/:forked_from_id' do
- let(:new_project_fork_source) { create(:project, :public) }
-
- it "shouldn't available for non admin users" do
- post api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", user)
- expect(response.status).to eq(403)
- end
-
- it 'should allow project to be forked from an existing project' do
- expect(project_fork_target.forked?).not_to be_truthy
- post api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", admin)
- expect(response.status).to eq(201)
- project_fork_target.reload
- expect(project_fork_target.forked_from_project.id).to eq(project_fork_source.id)
- expect(project_fork_target.forked_project_link).not_to be_nil
- expect(project_fork_target.forked?).to be_truthy
- end
-
- it 'should fail if forked_from project which does not exist' do
- post api("/projects/#{project_fork_target.id}/fork/9999", admin)
- expect(response.status).to eq(404)
- end
-
- it 'should fail with 409 if already forked' do
- post api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", admin)
- project_fork_target.reload
- expect(project_fork_target.forked_from_project.id).to eq(project_fork_source.id)
- post api("/projects/#{project_fork_target.id}/fork/#{new_project_fork_source.id}", admin)
- expect(response.status).to eq(409)
- project_fork_target.reload
- expect(project_fork_target.forked_from_project.id).to eq(project_fork_source.id)
- expect(project_fork_target.forked?).to be_truthy
- end
- end
-
- describe 'DELETE /projects/:id/fork' do
-
- it "shouldn't available for non admin users" do
- delete api("/projects/#{project_fork_target.id}/fork", user)
- expect(response.status).to eq(403)
- end
-
- it 'should make forked project unforked' do
- post api("/projects/#{project_fork_target.id}/fork/#{project_fork_source.id}", admin)
- project_fork_target.reload
- expect(project_fork_target.forked_from_project).not_to be_nil
- expect(project_fork_target.forked?).to be_truthy
- delete api("/projects/#{project_fork_target.id}/fork", admin)
- expect(response.status).to eq(200)
- project_fork_target.reload
- expect(project_fork_target.forked_from_project).to be_nil
- expect(project_fork_target.forked?).not_to be_truthy
- end
-
- it 'should be idempotent if not forked' do
- expect(project_fork_target.forked_from_project).to be_nil
- delete api("/projects/#{project_fork_target.id}/fork", admin)
- expect(response.status).to eq(200)
- expect(project_fork_target.reload.forked_from_project).to be_nil
- end
- end
- end
-
- describe 'GET /projects/search/:query' do
- let!(:query) { 'query'}
- let!(:search) { create(:empty_project, name: query, creator_id: user.id, namespace: user.namespace) }
- let!(:pre) { create(:empty_project, name: "pre_#{query}", creator_id: user.id, namespace: user.namespace) }
- let!(:post) { create(:empty_project, name: "#{query}_post", creator_id: user.id, namespace: user.namespace) }
- let!(:pre_post) { create(:empty_project, name: "pre_#{query}_post", creator_id: user.id, namespace: user.namespace) }
- let!(:unfound) { create(:empty_project, name: 'unfound', creator_id: user.id, namespace: user.namespace) }
- let!(:internal) { create(:empty_project, :internal, name: "internal #{query}") }
- let!(:unfound_internal) { create(:empty_project, :internal, name: 'unfound internal') }
- let!(:public) { create(:empty_project, :public, name: "public #{query}") }
- let!(:unfound_public) { create(:empty_project, :public, name: 'unfound public') }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- get api("/projects/search/#{query}")
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated' do
- it 'should return an array of projects' do
- get api("/projects/search/#{query}",user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.size).to eq(6)
- json_response.each {|project| expect(project['name']).to match(/.*query.*/)}
- end
- end
-
- context 'when authenticated as a different user' do
- it 'should return matching public projects' do
- get api("/projects/search/#{query}", user2)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.size).to eq(2)
- json_response.each {|project| expect(project['name']).to match(/(internal|public) query/)}
- end
- end
- end
-
- describe 'PUT /projects/:id̈́' do
- before { project }
- before { user }
- before { user3 }
- before { user4 }
- before { project3 }
- before { project4 }
- before { project_member3 }
- before { project_member2 }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- project_param = { name: 'bar' }
- put api("/projects/#{project.id}"), project_param
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated as project owner' do
- it 'should update name' do
- project_param = { name: 'bar' }
- put api("/projects/#{project.id}", user), project_param
- expect(response.status).to eq(200)
- project_param.each_pair do |k, v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should update visibility_level' do
- project_param = { visibility_level: 20 }
- put api("/projects/#{project3.id}", user), project_param
- expect(response.status).to eq(200)
- project_param.each_pair do |k, v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should not update name to existing name' do
- project_param = { name: project3.name }
- put api("/projects/#{project.id}", user), project_param
- expect(response.status).to eq(400)
- expect(json_response['message']['name']).to eq(['has already been taken'])
- end
-
- it 'should update path & name to existing path & name in different namespace' do
- project_param = { path: project4.path, name: project4.name }
- put api("/projects/#{project3.id}", user), project_param
- expect(response.status).to eq(200)
- project_param.each_pair do |k, v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
- end
-
- context 'when authenticated as project master' do
- it 'should update path' do
- project_param = { path: 'bar' }
- put api("/projects/#{project3.id}", user4), project_param
- expect(response.status).to eq(200)
- project_param.each_pair do |k, v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should update other attributes' do
- project_param = { issues_enabled: true,
- wiki_enabled: true,
- snippets_enabled: true,
- merge_requests_enabled: true,
- description: 'new description' }
-
- put api("/projects/#{project3.id}", user4), project_param
- expect(response.status).to eq(200)
- project_param.each_pair do |k, v|
- expect(json_response[k.to_s]).to eq(v)
- end
- end
-
- it 'should not update path to existing path' do
- project_param = { path: project.path }
- put api("/projects/#{project3.id}", user4), project_param
- expect(response.status).to eq(400)
- expect(json_response['message']['path']).to eq(['has already been taken'])
- end
-
- it 'should not update name' do
- project_param = { name: 'bar' }
- put api("/projects/#{project3.id}", user4), project_param
- expect(response.status).to eq(403)
- end
-
- it 'should not update visibility_level' do
- project_param = { visibility_level: 20 }
- put api("/projects/#{project3.id}", user4), project_param
- expect(response.status).to eq(403)
- end
- end
-
- context 'when authenticated as project developer' do
- it 'should not update other attributes' do
- project_param = { path: 'bar',
- issues_enabled: true,
- wiki_enabled: true,
- snippets_enabled: true,
- merge_requests_enabled: true,
- description: 'new description' }
- put api("/projects/#{project.id}", user3), project_param
- expect(response.status).to eq(403)
- end
- end
- end
-
- describe 'DELETE /projects/:id' do
- context 'when authenticated as user' do
- it 'should remove project' do
- expect(GitlabShellWorker).to(
- receive(:perform_async).with(:remove_repository,
- /#{project.path_with_namespace}/)
- ).twice
-
- delete api("/projects/#{project.id}", user)
- expect(response.status).to eq(200)
- end
-
- it 'should not remove a project if not an owner' do
- user3 = create(:user)
- project.team << [user3, :developer]
- delete api("/projects/#{project.id}", user3)
- expect(response.status).to eq(403)
- end
-
- it 'should not remove a non existing project' do
- delete api('/projects/1328', user)
- expect(response.status).to eq(404)
- end
-
- it 'should not remove a project not attached to user' do
- delete api("/projects/#{project.id}", user2)
- expect(response.status).to eq(404)
- end
- end
-
- context 'when authenticated as admin' do
- it 'should remove any existing project' do
- delete api("/projects/#{project.id}", admin)
- expect(response.status).to eq(200)
- end
-
- it 'should not remove a non existing project' do
- delete api('/projects/1328', admin)
- expect(response.status).to eq(404)
- end
- end
- end
-end
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
deleted file mode 100644
index 09a79553f729cab2d5d53320f474c4ff6fb01b72..0000000000000000000000000000000000000000
--- a/spec/requests/api/repositories_spec.rb
+++ /dev/null
@@ -1,247 +0,0 @@
-require 'spec_helper'
-require 'mime/types'
-
-describe API::API, api: true do
- include ApiHelpers
- include RepoHelpers
-
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
- let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
-
- describe "GET /projects/:id/repository/tags" do
- it "should return an array of project tags" do
- get api("/projects/#{project.id}/repository/tags", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['name']).to eq(project.repo.tags.sort_by(&:name).reverse.first.name)
- end
- end
-
- describe 'POST /projects/:id/repository/tags' do
- context 'lightweight tags' do
- it 'should create a new tag' do
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v7.0.1',
- ref: 'master'
-
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq('v7.0.1')
- end
- end
-
- context 'annotated tag' do
- it 'should create a new annotated tag' do
- # Identity must be set in .gitconfig to create annotated tag.
- repo_path = project.repository.path_to_repo
- system(*%W(git --git-dir=#{repo_path} config user.name #{user.name}))
- system(*%W(git --git-dir=#{repo_path} config user.email #{user.email}))
-
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v7.1.0',
- ref: 'master',
- message: 'Release 7.1.0'
-
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq('v7.1.0')
- expect(json_response['message']).to eq('Release 7.1.0')
- end
- end
-
- it 'should deny for user without push access' do
- post api("/projects/#{project.id}/repository/tags", user2),
- tag_name: 'v1.9.0',
- ref: '621491c677087aa243f165eab467bfdfbee00be1'
- expect(response.status).to eq(403)
- end
-
- it 'should return 400 if tag name is invalid' do
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v 1.0.0',
- ref: 'master'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Tag name invalid')
- end
-
- it 'should return 400 if tag already exists' do
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v8.0.0',
- ref: 'master'
- expect(response.status).to eq(201)
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v8.0.0',
- ref: 'master'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Tag already exists')
- end
-
- it 'should return 400 if ref name is invalid' do
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'mytag',
- ref: 'foo'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('Invalid reference name')
- end
- end
-
- describe "GET /projects/:id/repository/tree" do
- context "authorized user" do
- before { project.team << [user2, :reporter] }
-
- it "should return project commits" do
- get api("/projects/#{project.id}/repository/tree", user)
- expect(response.status).to eq(200)
-
- expect(json_response).to be_an Array
- expect(json_response.first['name']).to eq('encoding')
- expect(json_response.first['type']).to eq('tree')
- expect(json_response.first['mode']).to eq('040000')
- end
-
- it 'should return a 404 for unknown ref' do
- get api("/projects/#{project.id}/repository/tree?ref_name=foo", user)
- expect(response.status).to eq(404)
-
- expect(json_response).to be_an Object
- json_response['message'] == '404 Tree Not Found'
- end
- end
-
- context "unauthorized user" do
- it "should not return project commits" do
- get api("/projects/#{project.id}/repository/tree")
- expect(response.status).to eq(401)
- end
- end
- end
-
- describe "GET /projects/:id/repository/blobs/:sha" do
- it "should get the raw file contents" do
- get api("/projects/#{project.id}/repository/blobs/master?filepath=README.md", user)
- expect(response.status).to eq(200)
- end
-
- it "should return 404 for invalid branch_name" do
- get api("/projects/#{project.id}/repository/blobs/invalid_branch_name?filepath=README.md", user)
- expect(response.status).to eq(404)
- end
-
- it "should return 404 for invalid file" do
- get api("/projects/#{project.id}/repository/blobs/master?filepath=README.invalid", user)
- expect(response.status).to eq(404)
- end
-
- it "should return a 400 error if filepath is missing" do
- get api("/projects/#{project.id}/repository/blobs/master", user)
- expect(response.status).to eq(400)
- end
- end
-
- describe "GET /projects/:id/repository/commits/:sha/blob" do
- it "should get the raw file contents" do
- get api("/projects/#{project.id}/repository/commits/master/blob?filepath=README.md", user)
- expect(response.status).to eq(200)
- end
- end
-
- describe "GET /projects/:id/repository/raw_blobs/:sha" do
- it "should get the raw file contents" do
- get api("/projects/#{project.id}/repository/raw_blobs/#{sample_blob.oid}", user)
- expect(response.status).to eq(200)
- end
-
- it 'should return a 404 for unknown blob' do
- get api("/projects/#{project.id}/repository/raw_blobs/123456", user)
- expect(response.status).to eq(404)
-
- expect(json_response).to be_an Object
- json_response['message'] == '404 Blob Not Found'
- end
- end
-
- describe "GET /projects/:id/repository/archive(.:format)?:sha" do
- it "should get the archive" do
- get api("/projects/#{project.id}/repository/archive", user)
- repo_name = project.repository.name.gsub("\.git", "")
- expect(response.status).to eq(200)
- expect(response.headers['Content-Disposition']).to match(/filename\=\"#{repo_name}\-[^\.]+\.tar.gz\"/)
- expect(response.content_type).to eq(MIME::Types.type_for('file.tar.gz').first.content_type)
- end
-
- it "should get the archive.zip" do
- get api("/projects/#{project.id}/repository/archive.zip", user)
- repo_name = project.repository.name.gsub("\.git", "")
- expect(response.status).to eq(200)
- expect(response.headers['Content-Disposition']).to match(/filename\=\"#{repo_name}\-[^\.]+\.zip\"/)
- expect(response.content_type).to eq(MIME::Types.type_for('file.zip').first.content_type)
- end
-
- it "should get the archive.tar.bz2" do
- get api("/projects/#{project.id}/repository/archive.tar.bz2", user)
- repo_name = project.repository.name.gsub("\.git", "")
- expect(response.status).to eq(200)
- expect(response.headers['Content-Disposition']).to match(/filename\=\"#{repo_name}\-[^\.]+\.tar.bz2\"/)
- expect(response.content_type).to eq(MIME::Types.type_for('file.tar.bz2').first.content_type)
- end
-
- it "should return 404 for invalid sha" do
- get api("/projects/#{project.id}/repository/archive/?sha=xxx", user)
- expect(response.status).to eq(404)
- end
- end
-
- describe 'GET /projects/:id/repository/compare' do
- it "should compare branches" do
- get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'feature'
- expect(response.status).to eq(200)
- expect(json_response['commits']).to be_present
- expect(json_response['diffs']).to be_present
- end
-
- it "should compare tags" do
- get api("/projects/#{project.id}/repository/compare", user), from: 'v1.0.0', to: 'v1.1.0'
- expect(response.status).to eq(200)
- expect(json_response['commits']).to be_present
- expect(json_response['diffs']).to be_present
- end
-
- it "should compare commits" do
- get api("/projects/#{project.id}/repository/compare", user), from: sample_commit.id, to: sample_commit.parent_id
- expect(response.status).to eq(200)
- expect(json_response['commits']).to be_empty
- expect(json_response['diffs']).to be_empty
- expect(json_response['compare_same_ref']).to be_falsey
- end
-
- it "should compare commits in reverse order" do
- get api("/projects/#{project.id}/repository/compare", user), from: sample_commit.parent_id, to: sample_commit.id
- expect(response.status).to eq(200)
- expect(json_response['commits']).to be_present
- expect(json_response['diffs']).to be_present
- end
-
- it "should compare same refs" do
- get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'master'
- expect(response.status).to eq(200)
- expect(json_response['commits']).to be_empty
- expect(json_response['diffs']).to be_empty
- expect(json_response['compare_same_ref']).to be_truthy
- end
- end
-
- describe 'GET /projects/:id/repository/contributors' do
- it 'should return valid data' do
- get api("/projects/#{project.id}/repository/contributors", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- contributor = json_response.first
- expect(contributor['email']).to eq('dmitriy.zaporozhets@gmail.com')
- expect(contributor['name']).to eq('Dmitriy Zaporozhets')
- expect(contributor['commits']).to eq(13)
- expect(contributor['additions']).to eq(0)
- expect(contributor['deletions']).to eq(0)
- end
- end
-end
diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb
deleted file mode 100644
index 51c543578df747fec3bb0a5e5d3a7103248137a5..0000000000000000000000000000000000000000
--- a/spec/requests/api/services_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require "spec_helper"
-
-describe API::API, api: true do
- include ApiHelpers
- let(:user) { create(:user) }
- let(:project) {create(:project, creator_id: user.id, namespace: user.namespace) }
-
- describe "POST /projects/:id/services/gitlab-ci" do
- it "should update gitlab-ci settings" do
- put api("/projects/#{project.id}/services/gitlab-ci", user), token: 'secret-token', project_url: "http://ci.example.com/projects/1"
-
- expect(response.status).to eq(200)
- end
-
- it "should return if required fields missing" do
- put api("/projects/#{project.id}/services/gitlab-ci", user), project_url: "http://ci.example.com/projects/1", active: true
-
- expect(response.status).to eq(400)
- end
- end
-
- describe "DELETE /projects/:id/services/gitlab-ci" do
- it "should update gitlab-ci settings" do
- delete api("/projects/#{project.id}/services/gitlab-ci", user)
-
- expect(response.status).to eq(200)
- expect(project.gitlab_ci_service).to be_nil
- end
- end
-
- describe 'PUT /projects/:id/services/hipchat' do
- it 'should update hipchat settings' do
- put api("/projects/#{project.id}/services/hipchat", user),
- token: 'secret-token', room: 'test'
-
- expect(response.status).to eq(200)
- expect(project.hipchat_service).not_to be_nil
- end
-
- it 'should return if required fields missing' do
- put api("/projects/#{project.id}/services/gitlab-ci", user),
- token: 'secret-token', active: true
-
- expect(response.status).to eq(400)
- end
- end
-
- describe 'DELETE /projects/:id/services/hipchat' do
- it 'should delete hipchat settings' do
- delete api("/projects/#{project.id}/services/hipchat", user)
-
- expect(response.status).to eq(200)
- expect(project.hipchat_service).to be_nil
- end
- end
-end
diff --git a/spec/requests/api/session_spec.rb b/spec/requests/api/session_spec.rb
deleted file mode 100644
index fbd57b34a58d32308e969cdddf4b7b681011b645..0000000000000000000000000000000000000000
--- a/spec/requests/api/session_spec.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user) { create(:user) }
-
- describe "POST /session" do
- context "when valid password" do
- it "should return private token" do
- post api("/session"), email: user.email, password: '12345678'
- expect(response.status).to eq(201)
-
- expect(json_response['email']).to eq(user.email)
- expect(json_response['private_token']).to eq(user.private_token)
- expect(json_response['is_admin']).to eq(user.is_admin?)
- expect(json_response['can_create_project']).to eq(user.can_create_project?)
- expect(json_response['can_create_group']).to eq(user.can_create_group?)
- end
- end
-
- context 'when email has case-typo and password is valid' do
- it 'should return private token' do
- post api('/session'), email: user.email.upcase, password: '12345678'
- expect(response.status).to eq 201
-
- expect(json_response['email']).to eq user.email
- expect(json_response['private_token']).to eq user.private_token
- expect(json_response['is_admin']).to eq user.is_admin?
- expect(json_response['can_create_project']).to eq user.can_create_project?
- expect(json_response['can_create_group']).to eq user.can_create_group?
- end
- end
-
- context 'when login has case-typo and password is valid' do
- it 'should return private token' do
- post api('/session'), login: user.username.upcase, password: '12345678'
- expect(response.status).to eq 201
-
- expect(json_response['email']).to eq user.email
- expect(json_response['private_token']).to eq user.private_token
- expect(json_response['is_admin']).to eq user.is_admin?
- expect(json_response['can_create_project']).to eq user.can_create_project?
- expect(json_response['can_create_group']).to eq user.can_create_group?
- end
- end
-
- context "when invalid password" do
- it "should return authentication error" do
- post api("/session"), email: user.email, password: '123'
- expect(response.status).to eq(401)
-
- expect(json_response['email']).to be_nil
- expect(json_response['private_token']).to be_nil
- end
- end
-
- context "when empty password" do
- it "should return authentication error" do
- post api("/session"), email: user.email
- expect(response.status).to eq(401)
-
- expect(json_response['email']).to be_nil
- expect(json_response['private_token']).to be_nil
- end
- end
-
- context "when empty name" do
- it "should return authentication error" do
- post api("/session"), password: user.password
- expect(response.status).to eq(401)
-
- expect(json_response['email']).to be_nil
- expect(json_response['private_token']).to be_nil
- end
- end
- end
-end
diff --git a/spec/requests/api/system_hooks_spec.rb b/spec/requests/api/system_hooks_spec.rb
deleted file mode 100644
index a9d86bbce6c9165d715cecd235be557d27f5519a..0000000000000000000000000000000000000000
--- a/spec/requests/api/system_hooks_spec.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user) { create(:user) }
- let(:admin) { create(:admin) }
- let!(:hook) { create(:system_hook, url: "http://example.com") }
-
- before { stub_request(:post, hook.url) }
-
- describe "GET /hooks" do
- context "when no user" do
- it "should return authentication error" do
- get api("/hooks")
- expect(response.status).to eq(401)
- end
- end
-
- context "when not an admin" do
- it "should return forbidden error" do
- get api("/hooks", user)
- expect(response.status).to eq(403)
- end
- end
-
- context "when authenticated as admin" do
- it "should return an array of hooks" do
- get api("/hooks", admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['url']).to eq(hook.url)
- end
- end
- end
-
- describe "POST /hooks" do
- it "should create new hook" do
- expect {
- post api("/hooks", admin), url: 'http://example.com'
- }.to change { SystemHook.count }.by(1)
- end
-
- it "should respond with 400 if url not given" do
- post api("/hooks", admin)
- expect(response.status).to eq(400)
- end
-
- it "should not create new hook without url" do
- expect {
- post api("/hooks", admin)
- }.to_not change { SystemHook.count }
- end
- end
-
- describe "GET /hooks/:id" do
- it "should return hook by id" do
- get api("/hooks/#{hook.id}", admin)
- expect(response.status).to eq(200)
- expect(json_response['event_name']).to eq('project_create')
- end
-
- it "should return 404 on failure" do
- get api("/hooks/404", admin)
- expect(response.status).to eq(404)
- end
- end
-
- describe "DELETE /hooks/:id" do
- it "should delete a hook" do
- expect {
- delete api("/hooks/#{hook.id}", admin)
- }.to change { SystemHook.count }.by(-1)
- end
-
- it "should return success if hook id not found" do
- delete api("/hooks/12345", admin)
- expect(response.status).to eq(200)
- end
- end
-end
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
deleted file mode 100644
index e6d5545f81284d501473c97ac9be8bba0c8639a6..0000000000000000000000000000000000000000
--- a/spec/requests/api/users_spec.rb
+++ /dev/null
@@ -1,524 +0,0 @@
-require 'spec_helper'
-
-describe API::API, api: true do
- include ApiHelpers
-
- let(:user) { create(:user) }
- let(:admin) { create(:admin) }
- let(:key) { create(:key, user: user) }
-
- describe "GET /users" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/users")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated" do
- it "should return an array of users" do
- get api("/users", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- username = user.username
- expect(json_response.detect {
- |user| user['username'] == username
- }['username']).to eq(username)
- end
- end
-
- context "when admin" do
- it "should return an array of users" do
- get api("/users", admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first.keys).to include 'email'
- expect(json_response.first.keys).to include 'identities'
- expect(json_response.first.keys).to include 'can_create_project'
- end
- end
- end
-
- describe "GET /users/:id" do
- it "should return a user by id" do
- get api("/users/#{user.id}", user)
- expect(response.status).to eq(200)
- expect(json_response['username']).to eq(user.username)
- end
-
- it "should return a 401 if unauthenticated" do
- get api("/users/9998")
- expect(response.status).to eq(401)
- end
-
- it "should return a 404 error if user id not found" do
- get api("/users/9999", user)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Not found')
- end
- end
-
- describe "POST /users" do
- before{ admin }
-
- it "should create user" do
- expect {
- post api("/users", admin), attributes_for(:user, projects_limit: 3)
- }.to change { User.count }.by(1)
- end
-
- it "should create user with correct attributes" do
- post api('/users', admin), attributes_for(:user, admin: true, can_create_group: true)
- expect(response.status).to eq(201)
- user_id = json_response['id']
- new_user = User.find(user_id)
- expect(new_user).not_to eq(nil)
- expect(new_user.admin).to eq(true)
- expect(new_user.can_create_group).to eq(true)
- end
-
- it "should create non-admin user" do
- post api('/users', admin), attributes_for(:user, admin: false, can_create_group: false)
- expect(response.status).to eq(201)
- user_id = json_response['id']
- new_user = User.find(user_id)
- expect(new_user).not_to eq(nil)
- expect(new_user.admin).to eq(false)
- expect(new_user.can_create_group).to eq(false)
- end
-
- it "should create non-admin users by default" do
- post api('/users', admin), attributes_for(:user)
- expect(response.status).to eq(201)
- user_id = json_response['id']
- new_user = User.find(user_id)
- expect(new_user).not_to eq(nil)
- expect(new_user.admin).to eq(false)
- end
-
- it "should return 201 Created on success" do
- post api("/users", admin), attributes_for(:user, projects_limit: 3)
- expect(response.status).to eq(201)
- end
-
- it "should not create user with invalid email" do
- post api('/users', admin),
- email: 'invalid email',
- password: 'password',
- name: 'test'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 error if name not given' do
- post api('/users', admin), email: 'test@example.com', password: 'pass1234'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 error if password not given' do
- post api('/users', admin), email: 'test@example.com', name: 'test'
- expect(response.status).to eq(400)
- end
-
- it "should return 400 error if email not given" do
- post api('/users', admin), password: 'pass1234', name: 'test'
- expect(response.status).to eq(400)
- end
-
- it 'should return 400 error if user does not validate' do
- post api('/users', admin),
- password: 'pass',
- email: 'test@example.com',
- username: 'test!',
- name: 'test',
- bio: 'g' * 256,
- projects_limit: -1
- expect(response.status).to eq(400)
- expect(json_response['message']['password']).
- to eq(['is too short (minimum is 8 characters)'])
- expect(json_response['message']['bio']).
- to eq(['is too long (maximum is 255 characters)'])
- expect(json_response['message']['projects_limit']).
- to eq(['must be greater than or equal to 0'])
- expect(json_response['message']['username']).
- to eq([Gitlab::Regex.send(:namespace_regex_message)])
- end
-
- it "shouldn't available for non admin users" do
- post api("/users", user), attributes_for(:user)
- expect(response.status).to eq(403)
- end
-
- context 'with existing user' do
- before do
- post api('/users', admin),
- email: 'test@example.com',
- password: 'password',
- username: 'test',
- name: 'foo'
- end
-
- it 'should return 409 conflict error if user with same email exists' do
- expect {
- post api('/users', admin),
- name: 'foo',
- email: 'test@example.com',
- password: 'password',
- username: 'foo'
- }.to change { User.count }.by(0)
- expect(response.status).to eq(409)
- expect(json_response['message']).to eq('Email has already been taken')
- end
-
- it 'should return 409 conflict error if same username exists' do
- expect do
- post api('/users', admin),
- name: 'foo',
- email: 'foo@example.com',
- password: 'password',
- username: 'test'
- end.to change { User.count }.by(0)
- expect(response.status).to eq(409)
- expect(json_response['message']).to eq('Username has already been taken')
- end
- end
- end
-
- describe "GET /users/sign_up" do
-
- it "should redirect to sign in page" do
- get "/users/sign_up"
- expect(response.status).to eq(302)
- expect(response).to redirect_to(new_user_session_path)
- end
- end
-
- describe "PUT /users/:id" do
- let!(:admin_user) { create(:admin) }
-
- before { admin }
-
- it "should update user with new bio" do
- put api("/users/#{user.id}", admin), {bio: 'new test bio'}
- expect(response.status).to eq(200)
- expect(json_response['bio']).to eq('new test bio')
- expect(user.reload.bio).to eq('new test bio')
- end
-
- it 'should update user with his own email' do
- put api("/users/#{user.id}", admin), email: user.email
- expect(response.status).to eq(200)
- expect(json_response['email']).to eq(user.email)
- expect(user.reload.email).to eq(user.email)
- end
-
- it 'should update user with his own username' do
- put api("/users/#{user.id}", admin), username: user.username
- expect(response.status).to eq(200)
- expect(json_response['username']).to eq(user.username)
- expect(user.reload.username).to eq(user.username)
- end
-
- it "should update admin status" do
- put api("/users/#{user.id}", admin), {admin: true}
- expect(response.status).to eq(200)
- expect(json_response['is_admin']).to eq(true)
- expect(user.reload.admin).to eq(true)
- end
-
- it "should not update admin status" do
- put api("/users/#{admin_user.id}", admin), {can_create_group: false}
- expect(response.status).to eq(200)
- expect(json_response['is_admin']).to eq(true)
- expect(admin_user.reload.admin).to eq(true)
- expect(admin_user.can_create_group).to eq(false)
- end
-
- it "should not allow invalid update" do
- put api("/users/#{user.id}", admin), {email: 'invalid email'}
- expect(response.status).to eq(400)
- expect(user.reload.email).not_to eq('invalid email')
- end
-
- it "shouldn't available for non admin users" do
- put api("/users/#{user.id}", user), attributes_for(:user)
- expect(response.status).to eq(403)
- end
-
- it "should return 404 for non-existing user" do
- put api("/users/999999", admin), {bio: 'update should fail'}
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Not found')
- end
-
- it 'should return 400 error if user does not validate' do
- put api("/users/#{user.id}", admin),
- password: 'pass',
- email: 'test@example.com',
- username: 'test!',
- name: 'test',
- bio: 'g' * 256,
- projects_limit: -1
- expect(response.status).to eq(400)
- expect(json_response['message']['password']).
- to eq(['is too short (minimum is 8 characters)'])
- expect(json_response['message']['bio']).
- to eq(['is too long (maximum is 255 characters)'])
- expect(json_response['message']['projects_limit']).
- to eq(['must be greater than or equal to 0'])
- expect(json_response['message']['username']).
- to eq([Gitlab::Regex.send(:namespace_regex_message)])
- end
-
- context "with existing user" do
- before {
- post api("/users", admin), { email: 'test@example.com', password: 'password', username: 'test', name: 'test' }
- post api("/users", admin), { email: 'foo@bar.com', password: 'password', username: 'john', name: 'john' }
- @user = User.all.last
- }
-
- it 'should return 409 conflict error if email address exists' do
- put api("/users/#{@user.id}", admin), email: 'test@example.com'
- expect(response.status).to eq(409)
- expect(@user.reload.email).to eq(@user.email)
- end
-
- it 'should return 409 conflict error if username taken' do
- @user_id = User.all.last.id
- put api("/users/#{@user.id}", admin), username: 'test'
- expect(response.status).to eq(409)
- expect(@user.reload.username).to eq(@user.username)
- end
- end
- end
-
- describe "POST /users/:id/keys" do
- before { admin }
-
- it "should not create invalid ssh key" do
- post api("/users/#{user.id}/keys", admin), { title: "invalid key" }
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('400 (Bad request) "key" not given')
- end
-
- it 'should not create key without title' do
- post api("/users/#{user.id}/keys", admin), key: 'some key'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('400 (Bad request) "title" not given')
- end
-
- it "should create ssh key" do
- key_attrs = attributes_for :key
- expect {
- post api("/users/#{user.id}/keys", admin), key_attrs
- }.to change{ user.keys.count }.by(1)
- end
- end
-
- describe 'GET /user/:uid/keys' do
- before { admin }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- get api("/users/#{user.id}/keys")
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated' do
- it 'should return 404 for non-existing user' do
- get api('/users/999999/keys', admin)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 User Not Found')
- end
-
- it 'should return array of ssh keys' do
- user.keys << key
- user.save
- get api("/users/#{user.id}/keys", admin)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first['title']).to eq(key.title)
- end
- end
- end
-
- describe 'DELETE /user/:uid/keys/:id' do
- before { admin }
-
- context 'when unauthenticated' do
- it 'should return authentication error' do
- delete api("/users/#{user.id}/keys/42")
- expect(response.status).to eq(401)
- end
- end
-
- context 'when authenticated' do
- it 'should delete existing key' do
- user.keys << key
- user.save
- expect {
- delete api("/users/#{user.id}/keys/#{key.id}", admin)
- }.to change { user.keys.count }.by(-1)
- expect(response.status).to eq(200)
- end
-
- it 'should return 404 error if user not found' do
- user.keys << key
- user.save
- delete api("/users/999999/keys/#{key.id}", admin)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 User Not Found')
- end
-
- it 'should return 404 error if key not foud' do
- delete api("/users/#{user.id}/keys/42", admin)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Key Not Found')
- end
- end
- end
-
- describe "DELETE /users/:id" do
- before { admin }
-
- it "should delete user" do
- delete api("/users/#{user.id}", admin)
- expect(response.status).to eq(200)
- expect { User.find(user.id) }.to raise_error ActiveRecord::RecordNotFound
- expect(json_response['email']).to eq(user.email)
- end
-
- it "should not delete for unauthenticated user" do
- delete api("/users/#{user.id}")
- expect(response.status).to eq(401)
- end
-
- it "shouldn't available for non admin users" do
- delete api("/users/#{user.id}", user)
- expect(response.status).to eq(403)
- end
-
- it "should return 404 for non-existing user" do
- delete api("/users/999999", admin)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 User Not Found')
- end
- end
-
- describe "GET /user" do
- it "should return current user" do
- get api("/user", user)
- expect(response.status).to eq(200)
- expect(json_response['email']).to eq(user.email)
- expect(json_response['is_admin']).to eq(user.is_admin?)
- expect(json_response['can_create_project']).to eq(user.can_create_project?)
- expect(json_response['can_create_group']).to eq(user.can_create_group?)
- expect(json_response['projects_limit']).to eq(user.projects_limit)
- end
-
- it "should return 401 error if user is unauthenticated" do
- get api("/user")
- expect(response.status).to eq(401)
- end
- end
-
- describe "GET /user/keys" do
- context "when unauthenticated" do
- it "should return authentication error" do
- get api("/user/keys")
- expect(response.status).to eq(401)
- end
- end
-
- context "when authenticated" do
- it "should return array of ssh keys" do
- user.keys << key
- user.save
- get api("/user/keys", user)
- expect(response.status).to eq(200)
- expect(json_response).to be_an Array
- expect(json_response.first["title"]).to eq(key.title)
- end
- end
- end
-
- describe "GET /user/keys/:id" do
- it "should return single key" do
- user.keys << key
- user.save
- get api("/user/keys/#{key.id}", user)
- expect(response.status).to eq(200)
- expect(json_response["title"]).to eq(key.title)
- end
-
- it "should return 404 Not Found within invalid ID" do
- get api("/user/keys/42", user)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Not found')
- end
-
- it "should return 404 error if admin accesses user's ssh key" do
- user.keys << key
- user.save
- admin
- get api("/user/keys/#{key.id}", admin)
- expect(response.status).to eq(404)
- expect(json_response['message']).to eq('404 Not found')
- end
- end
-
- describe "POST /user/keys" do
- it "should create ssh key" do
- key_attrs = attributes_for :key
- expect {
- post api("/user/keys", user), key_attrs
- }.to change{ user.keys.count }.by(1)
- expect(response.status).to eq(201)
- end
-
- it "should return a 401 error if unauthorized" do
- post api("/user/keys"), title: 'some title', key: 'some key'
- expect(response.status).to eq(401)
- end
-
- it "should not create ssh key without key" do
- post api("/user/keys", user), title: 'title'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('400 (Bad request) "key" not given')
- end
-
- it 'should not create ssh key without title' do
- post api('/user/keys', user), key: 'some key'
- expect(response.status).to eq(400)
- expect(json_response['message']).to eq('400 (Bad request) "title" not given')
- end
-
- it "should not create ssh key without title" do
- post api("/user/keys", user), key: "somekey"
- expect(response.status).to eq(400)
- end
- end
-
- describe "DELETE /user/keys/:id" do
- it "should delete existed key" do
- user.keys << key
- user.save
- expect {
- delete api("/user/keys/#{key.id}", user)
- }.to change{user.keys.count}.by(-1)
- expect(response.status).to eq(200)
- end
-
- it "should return success if key ID not found" do
- delete api("/user/keys/42", user)
- expect(response.status).to eq(200)
- end
-
- it "should return 401 error if unauthorized" do
- user.keys << key
- user.save
- delete api("/user/keys/#{key.id}")
- expect(response.status).to eq(401)
- end
- end
-end
diff --git a/spec/routing/admin_routing_spec.rb b/spec/routing/admin_routing_spec.rb
deleted file mode 100644
index bf8abcfb00f86ba4293748f0a5e232c82357ff6e..0000000000000000000000000000000000000000
--- a/spec/routing/admin_routing_spec.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require 'spec_helper'
-
-# team_update_admin_user PUT /admin/users/:id/team_update(.:format) admin/users#team_update
-# block_admin_user PUT /admin/users/:id/block(.:format) admin/users#block
-# unblock_admin_user PUT /admin/users/:id/unblock(.:format) admin/users#unblock
-# admin_users GET /admin/users(.:format) admin/users#index
-# POST /admin/users(.:format) admin/users#create
-# new_admin_user GET /admin/users/new(.:format) admin/users#new
-# edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
-# admin_user GET /admin/users/:id(.:format) admin/users#show
-# PUT /admin/users/:id(.:format) admin/users#update
-# DELETE /admin/users/:id(.:format) admin/users#destroy
-describe Admin::UsersController, "routing" do
- it "to #team_update" do
- expect(put("/admin/users/1/team_update")).to route_to('admin/users#team_update', id: '1')
- end
-
- it "to #block" do
- expect(put("/admin/users/1/block")).to route_to('admin/users#block', id: '1')
- end
-
- it "to #unblock" do
- expect(put("/admin/users/1/unblock")).to route_to('admin/users#unblock', id: '1')
- end
-
- it "to #index" do
- expect(get("/admin/users")).to route_to('admin/users#index')
- end
-
- it "to #show" do
- expect(get("/admin/users/1")).to route_to('admin/users#show', id: '1')
- end
-
- it "to #create" do
- expect(post("/admin/users")).to route_to('admin/users#create')
- end
-
- it "to #new" do
- expect(get("/admin/users/new")).to route_to('admin/users#new')
- end
-
- it "to #edit" do
- expect(get("/admin/users/1/edit")).to route_to('admin/users#edit', id: '1')
- end
-
- it "to #show" do
- expect(get("/admin/users/1")).to route_to('admin/users#show', id: '1')
- end
-
- it "to #update" do
- expect(put("/admin/users/1")).to route_to('admin/users#update', id: '1')
- end
-
- it "to #destroy" do
- expect(delete("/admin/users/1")).to route_to('admin/users#destroy', id: '1')
- end
-end
-
-# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {id: /[^\/]+/}
-# team_update_admin_project PUT /admin/projects/:id/team_update(.:format) admin/projects#team_update {id: /[^\/]+/}
-# admin_projects GET /admin/projects(.:format) admin/projects#index {id: /[^\/]+/}
-# POST /admin/projects(.:format) admin/projects#create {id: /[^\/]+/}
-# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {id: /[^\/]+/}
-# edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {id: /[^\/]+/}
-# admin_project GET /admin/projects/:id(.:format) admin/projects#show {id: /[^\/]+/}
-# PUT /admin/projects/:id(.:format) admin/projects#update {id: /[^\/]+/}
-# DELETE /admin/projects/:id(.:format) admin/projects#destroy {id: /[^\/]+/}
-describe Admin::ProjectsController, "routing" do
- it "to #index" do
- expect(get("/admin/projects")).to route_to('admin/projects#index')
- end
-
- it "to #show" do
- expect(get("/admin/projects/gitlab")).to route_to('admin/projects#show', namespace_id: 'gitlab')
- end
-end
-
-# admin_hook_test GET /admin/hooks/:hook_id/test(.:format) admin/hooks#test
-# admin_hooks GET /admin/hooks(.:format) admin/hooks#index
-# POST /admin/hooks(.:format) admin/hooks#create
-# admin_hook DELETE /admin/hooks/:id(.:format) admin/hooks#destroy
-describe Admin::HooksController, "routing" do
- it "to #test" do
- expect(get("/admin/hooks/1/test")).to route_to('admin/hooks#test', hook_id: '1')
- end
-
- it "to #index" do
- expect(get("/admin/hooks")).to route_to('admin/hooks#index')
- end
-
- it "to #create" do
- expect(post("/admin/hooks")).to route_to('admin/hooks#create')
- end
-
- it "to #destroy" do
- expect(delete("/admin/hooks/1")).to route_to('admin/hooks#destroy', id: '1')
- end
-
-end
-
-# admin_logs GET /admin/logs(.:format) admin/logs#show
-describe Admin::LogsController, "routing" do
- it "to #show" do
- expect(get("/admin/logs")).to route_to('admin/logs#show')
- end
-end
-
-# admin_background_jobs GET /admin/background_jobs(.:format) admin/background_jobs#show
-describe Admin::BackgroundJobsController, "routing" do
- it "to #show" do
- expect(get("/admin/background_jobs")).to route_to('admin/background_jobs#show')
- end
-end
-
-# admin_root /admin(.:format) admin/dashboard#index
-describe Admin::DashboardController, "routing" do
- it "to #index" do
- expect(get("/admin")).to route_to('admin/dashboard#index')
- end
-end
-
diff --git a/spec/routing/notifications_routing_spec.rb b/spec/routing/notifications_routing_spec.rb
deleted file mode 100644
index 24592942a967e77b20d38dc6391550af2890239d..0000000000000000000000000000000000000000
--- a/spec/routing/notifications_routing_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require "spec_helper"
-
-describe Profiles::NotificationsController do
- describe "routing" do
- it "routes to #show" do
- expect(get("/profile/notifications")).to route_to("profiles/notifications#show")
- end
-
- it "routes to #update" do
- expect(put("/profile/notifications")).to route_to("profiles/notifications#update")
- end
- end
-end
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
deleted file mode 100644
index 042352311da9dfbe843ea785228a1d5bd0e61bf2..0000000000000000000000000000000000000000
--- a/spec/routing/project_routing_spec.rb
+++ /dev/null
@@ -1,492 +0,0 @@
-require 'spec_helper'
-
-# Shared examples for a resource inside a Project
-#
-# By default it tests all the default REST actions: index, create, new, edit,
-# show, update, and destroy. You can remove actions by customizing the
-# `actions` variable.
-#
-# It also expects a `controller` variable to be available which defines both
-# the path to the resource as well as the controller name.
-#
-# Examples
-#
-# # Default behavior
-# it_behaves_like 'RESTful project resources' do
-# let(:controller) { 'issues' }
-# end
-#
-# # Customizing actions
-# it_behaves_like 'RESTful project resources' do
-# let(:actions) { [:index] }
-# let(:controller) { 'issues' }
-# end
-shared_examples 'RESTful project resources' do
- let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] }
-
- it 'to #index' do
- expect(get("/gitlab/gitlabhq/#{controller}")).to route_to("projects/#{controller}#index", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:index)
- end
-
- it 'to #create' do
- expect(post("/gitlab/gitlabhq/#{controller}")).to route_to("projects/#{controller}#create", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:create)
- end
-
- it 'to #new' do
- expect(get("/gitlab/gitlabhq/#{controller}/new")).to route_to("projects/#{controller}#new", namespace_id: 'gitlab', project_id: 'gitlabhq') if actions.include?(:new)
- end
-
- it 'to #edit' do
- expect(get("/gitlab/gitlabhq/#{controller}/1/edit")).to route_to("projects/#{controller}#edit", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:edit)
- end
-
- it 'to #show' do
- expect(get("/gitlab/gitlabhq/#{controller}/1")).to route_to("projects/#{controller}#show", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:show)
- end
-
- it 'to #update' do
- expect(put("/gitlab/gitlabhq/#{controller}/1")).to route_to("projects/#{controller}#update", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:update)
- end
-
- it 'to #destroy' do
- expect(delete("/gitlab/gitlabhq/#{controller}/1")).to route_to("projects/#{controller}#destroy", namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') if actions.include?(:destroy)
- end
-end
-
-# projects POST /projects(.:format) projects#create
-# new_project GET /projects/new(.:format) projects#new
-# files_project GET /:id/files(.:format) projects#files
-# edit_project GET /:id/edit(.:format) projects#edit
-# project GET /:id(.:format) projects#show
-# PUT /:id(.:format) projects#update
-# DELETE /:id(.:format) projects#destroy
-# markdown_preview_project POST /:id/markdown_preview(.:format) projects#markdown_preview
-describe ProjectsController, 'routing' do
- it 'to #create' do
- expect(post('/projects')).to route_to('projects#create')
- end
-
- it 'to #new' do
- expect(get('/projects/new')).to route_to('projects#new')
- end
-
- it 'to #edit' do
- expect(get('/gitlab/gitlabhq/edit')).to route_to('projects#edit', namespace_id: 'gitlab', id: 'gitlabhq')
- end
-
- it 'to #autocomplete_sources' do
- expect(get('/gitlab/gitlabhq/autocomplete_sources')).to route_to('projects#autocomplete_sources', namespace_id: 'gitlab', id: 'gitlabhq')
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq')).to route_to('projects#show', namespace_id: 'gitlab', id: 'gitlabhq')
- end
-
- it 'to #update' do
- expect(put('/gitlab/gitlabhq')).to route_to('projects#update', namespace_id: 'gitlab', id: 'gitlabhq')
- end
-
- it 'to #destroy' do
- expect(delete('/gitlab/gitlabhq')).to route_to('projects#destroy', namespace_id: 'gitlab', id: 'gitlabhq')
- end
-
- it 'to #markdown_preview' do
- expect(post('/gitlab/gitlabhq/markdown_preview')).to(
- route_to('projects#markdown_preview', namespace_id: 'gitlab', id: 'gitlabhq')
- )
- end
-end
-
-# pages_project_wikis GET /:project_id/wikis/pages(.:format) projects/wikis#pages
-# history_project_wiki GET /:project_id/wikis/:id/history(.:format) projects/wikis#history
-# project_wikis POST /:project_id/wikis(.:format) projects/wikis#create
-# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) projects/wikis#edit
-# project_wiki GET /:project_id/wikis/:id(.:format) projects/wikis#show
-# DELETE /:project_id/wikis/:id(.:format) projects/wikis#destroy
-describe Projects::WikisController, 'routing' do
- it 'to #pages' do
- expect(get('/gitlab/gitlabhq/wikis/pages')).to route_to('projects/wikis#pages', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #history' do
- expect(get('/gitlab/gitlabhq/wikis/1/history')).to route_to('projects/wikis#history', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:create, :edit, :show, :destroy] }
- let(:controller) { 'wikis' }
- end
-end
-
-# branches_project_repository GET /:project_id/repository/branches(.:format) projects/repositories#branches
-# tags_project_repository GET /:project_id/repository/tags(.:format) projects/repositories#tags
-# archive_project_repository GET /:project_id/repository/archive(.:format) projects/repositories#archive
-# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit
-describe Projects::RepositoriesController, 'routing' do
- it 'to #archive' do
- expect(get('/gitlab/gitlabhq/repository/archive')).to route_to('projects/repositories#archive', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #archive format:zip' do
- expect(get('/gitlab/gitlabhq/repository/archive.zip')).to route_to('projects/repositories#archive', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'zip')
- end
-
- it 'to #archive format:tar.bz2' do
- expect(get('/gitlab/gitlabhq/repository/archive.tar.bz2')).to route_to('projects/repositories#archive', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'tar.bz2')
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/repository')).to route_to('projects/repositories#show', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-end
-
-describe Projects::BranchesController, 'routing' do
- it 'to #branches' do
- expect(get('/gitlab/gitlabhq/branches')).to route_to('projects/branches#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
- expect(delete('/gitlab/gitlabhq/branches/feature%2345')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45')
- expect(delete('/gitlab/gitlabhq/branches/feature%2B45')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45')
- expect(delete('/gitlab/gitlabhq/branches/feature@45')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45')
- expect(delete('/gitlab/gitlabhq/branches/feature%2345/foo/bar/baz')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45/foo/bar/baz')
- expect(delete('/gitlab/gitlabhq/branches/feature%2B45/foo/bar/baz')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45/foo/bar/baz')
- expect(delete('/gitlab/gitlabhq/branches/feature@45/foo/bar/baz')).to route_to('projects/branches#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45/foo/bar/baz')
- end
-end
-
-describe Projects::TagsController, 'routing' do
- it 'to #tags' do
- expect(get('/gitlab/gitlabhq/tags')).to route_to('projects/tags#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
- expect(delete('/gitlab/gitlabhq/tags/feature%2345')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45')
- expect(delete('/gitlab/gitlabhq/tags/feature%2B45')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45')
- expect(delete('/gitlab/gitlabhq/tags/feature@45')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45')
- expect(delete('/gitlab/gitlabhq/tags/feature%2345/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45/foo/bar/baz')
- expect(delete('/gitlab/gitlabhq/tags/feature%2B45/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45/foo/bar/baz')
- expect(delete('/gitlab/gitlabhq/tags/feature@45/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45/foo/bar/baz')
- end
-end
-
-
-# project_deploy_keys GET /:project_id/deploy_keys(.:format) deploy_keys#index
-# POST /:project_id/deploy_keys(.:format) deploy_keys#create
-# new_project_deploy_key GET /:project_id/deploy_keys/new(.:format) deploy_keys#new
-# project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show
-# DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy
-describe Projects::DeployKeysController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:index, :show, :new, :create] }
- let(:controller) { 'deploy_keys' }
- end
-end
-
-# project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index
-# POST /:project_id/protected_branches(.:format) protected_branches#create
-# project_protected_branch DELETE /:project_id/protected_branches/:id(.:format) protected_branches#destroy
-describe Projects::ProtectedBranchesController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:index, :create, :destroy] }
- let(:controller) { 'protected_branches' }
- end
-end
-
-# switch_project_refs GET /:project_id/refs/switch(.:format) refs#switch
-# logs_tree_project_ref GET /:project_id/refs/:id/logs_tree(.:format) refs#logs_tree
-# logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree
-describe Projects::RefsController, 'routing' do
- it 'to #switch' do
- expect(get('/gitlab/gitlabhq/refs/switch')).to route_to('projects/refs#switch', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #logs_tree' do
- expect(get('/gitlab/gitlabhq/refs/stable/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable')
- expect(get('/gitlab/gitlabhq/refs/feature%2345/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45')
- expect(get('/gitlab/gitlabhq/refs/feature%2B45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45')
- expect(get('/gitlab/gitlabhq/refs/feature@45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45')
- expect(get('/gitlab/gitlabhq/refs/stable/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
- expect(get('/gitlab/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz')
- expect(get('/gitlab/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz')
- expect(get('/gitlab/gitlabhq/refs/feature@45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45', path: 'foo/bar/baz')
- expect(get('/gitlab/gitlabhq/refs/stable/logs_tree/files.scss')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'files.scss')
- end
-end
-
-# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) projects/merge_requests#diffs
-# automerge_project_merge_request POST /:project_id/merge_requests/:id/automerge(.:format) projects/merge_requests#automerge
-# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) projects/merge_requests#automerge_check
-# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) projects/merge_requests#branch_from
-# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) projects/merge_requests#branch_to
-# project_merge_requests GET /:project_id/merge_requests(.:format) projects/merge_requests#index
-# POST /:project_id/merge_requests(.:format) projects/merge_requests#create
-# new_project_merge_request GET /:project_id/merge_requests/new(.:format) projects/merge_requests#new
-# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) projects/merge_requests#edit
-# project_merge_request GET /:project_id/merge_requests/:id(.:format) projects/merge_requests#show
-# PUT /:project_id/merge_requests/:id(.:format) projects/merge_requests#update
-# DELETE /:project_id/merge_requests/:id(.:format) projects/merge_requests#destroy
-describe Projects::MergeRequestsController, 'routing' do
- it 'to #diffs' do
- expect(get('/gitlab/gitlabhq/merge_requests/1/diffs')).to route_to('projects/merge_requests#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #automerge' do
- expect(post('/gitlab/gitlabhq/merge_requests/1/automerge')).to route_to(
- 'projects/merge_requests#automerge',
- namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1'
- )
- end
-
- it 'to #automerge_check' do
- expect(get('/gitlab/gitlabhq/merge_requests/1/automerge_check')).to route_to('projects/merge_requests#automerge_check', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #branch_from' do
- expect(get('/gitlab/gitlabhq/merge_requests/branch_from')).to route_to('projects/merge_requests#branch_from', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #branch_to' do
- expect(get('/gitlab/gitlabhq/merge_requests/branch_to')).to route_to('projects/merge_requests#branch_to', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/merge_requests/1.diff')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'diff')
- expect(get('/gitlab/gitlabhq/merge_requests/1.patch')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'patch')
- end
-
- it_behaves_like 'RESTful project resources' do
- let(:controller) { 'merge_requests' }
- let(:actions) { [:index, :create, :new, :edit, :show, :update] }
- end
-end
-
-# raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw
-# project_snippets GET /:project_id/snippets(.:format) snippets#index
-# POST /:project_id/snippets(.:format) snippets#create
-# new_project_snippet GET /:project_id/snippets/new(.:format) snippets#new
-# edit_project_snippet GET /:project_id/snippets/:id/edit(.:format) snippets#edit
-# project_snippet GET /:project_id/snippets/:id(.:format) snippets#show
-# PUT /:project_id/snippets/:id(.:format) snippets#update
-# DELETE /:project_id/snippets/:id(.:format) snippets#destroy
-describe SnippetsController, 'routing' do
- it 'to #raw' do
- expect(get('/gitlab/gitlabhq/snippets/1/raw')).to route_to('projects/snippets#raw', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #index' do
- expect(get('/gitlab/gitlabhq/snippets')).to route_to('projects/snippets#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #create' do
- expect(post('/gitlab/gitlabhq/snippets')).to route_to('projects/snippets#create', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #new' do
- expect(get('/gitlab/gitlabhq/snippets/new')).to route_to('projects/snippets#new', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #edit' do
- expect(get('/gitlab/gitlabhq/snippets/1/edit')).to route_to('projects/snippets#edit', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/snippets/1')).to route_to('projects/snippets#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #update' do
- expect(put('/gitlab/gitlabhq/snippets/1')).to route_to('projects/snippets#update', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it 'to #destroy' do
- expect(delete('/gitlab/gitlabhq/snippets/1')).to route_to('projects/snippets#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-end
-
-# test_project_hook GET /:project_id/hooks/:id/test(.:format) hooks#test
-# project_hooks GET /:project_id/hooks(.:format) hooks#index
-# POST /:project_id/hooks(.:format) hooks#create
-# project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy
-describe Projects::HooksController, 'routing' do
- it 'to #test' do
- expect(get('/gitlab/gitlabhq/hooks/1/test')).to route_to('projects/hooks#test', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
- end
-
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:index, :create, :destroy] }
- let(:controller) { 'hooks' }
- end
-end
-
-# project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/}
-describe Projects::CommitController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/commit/4246fb')).to route_to('projects/commit#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '4246fb')
- expect(get('/gitlab/gitlabhq/commit/4246fb.diff')).to route_to('projects/commit#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '4246fb', format: 'diff')
- expect(get('/gitlab/gitlabhq/commit/4246fb.patch')).to route_to('projects/commit#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '4246fb', format: 'patch')
- expect(get('/gitlab/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5')).to route_to('projects/commit#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5')
- end
-end
-
-# patch_project_commit GET /:project_id/commits/:id/patch(.:format) commits#patch
-# project_commits GET /:project_id/commits(.:format) commits#index
-# POST /:project_id/commits(.:format) commits#create
-# project_commit GET /:project_id/commits/:id(.:format) commits#show
-describe Projects::CommitsController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:show] }
- let(:controller) { 'commits' }
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/commits/master.atom')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master', format: 'atom')
- end
-end
-
-# project_project_members GET /:project_id/project_members(.:format) project_members#index
-# POST /:project_id/project_members(.:format) project_members#create
-# PUT /:project_id/project_members/:id(.:format) project_members#update
-# DELETE /:project_id/project_members/:id(.:format) project_members#destroy
-describe Projects::ProjectMembersController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:index, :create, :update, :destroy] }
- let(:controller) { 'project_members' }
- end
-end
-
-# project_milestones GET /:project_id/milestones(.:format) milestones#index
-# POST /:project_id/milestones(.:format) milestones#create
-# new_project_milestone GET /:project_id/milestones/new(.:format) milestones#new
-# edit_project_milestone GET /:project_id/milestones/:id/edit(.:format) milestones#edit
-# project_milestone GET /:project_id/milestones/:id(.:format) milestones#show
-# PUT /:project_id/milestones/:id(.:format) milestones#update
-# DELETE /:project_id/milestones/:id(.:format) milestones#destroy
-describe Projects::MilestonesController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:controller) { 'milestones' }
- let(:actions) { [:index, :create, :new, :edit, :show, :update] }
- end
-end
-
-# project_labels GET /:project_id/labels(.:format) labels#index
-describe Projects::LabelsController, 'routing' do
- it 'to #index' do
- expect(get('/gitlab/gitlabhq/labels')).to route_to('projects/labels#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-end
-
-# sort_project_issues POST /:project_id/issues/sort(.:format) issues#sort
-# bulk_update_project_issues POST /:project_id/issues/bulk_update(.:format) issues#bulk_update
-# search_project_issues GET /:project_id/issues/search(.:format) issues#search
-# project_issues GET /:project_id/issues(.:format) issues#index
-# POST /:project_id/issues(.:format) issues#create
-# new_project_issue GET /:project_id/issues/new(.:format) issues#new
-# edit_project_issue GET /:project_id/issues/:id/edit(.:format) issues#edit
-# project_issue GET /:project_id/issues/:id(.:format) issues#show
-# PUT /:project_id/issues/:id(.:format) issues#update
-# DELETE /:project_id/issues/:id(.:format) issues#destroy
-describe Projects::IssuesController, 'routing' do
- it 'to #bulk_update' do
- expect(post('/gitlab/gitlabhq/issues/bulk_update')).to route_to('projects/issues#bulk_update', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it_behaves_like 'RESTful project resources' do
- let(:controller) { 'issues' }
- let(:actions) { [:index, :create, :new, :edit, :show, :update] }
- end
-end
-
-# project_notes GET /:project_id/notes(.:format) notes#index
-# POST /:project_id/notes(.:format) notes#create
-# project_note DELETE /:project_id/notes/:id(.:format) notes#destroy
-describe Projects::NotesController, 'routing' do
- it_behaves_like 'RESTful project resources' do
- let(:actions) { [:index, :create, :destroy] }
- let(:controller) { 'notes' }
- end
-end
-
-# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/}
-describe Projects::BlameController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/blame/master/app/models/project.rb')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
- expect(get('/gitlab/gitlabhq/blame/master/files.scss')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
- end
-end
-
-# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/}
-describe Projects::BlobController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/blob/master/app/models/project.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
- expect(get('/gitlab/gitlabhq/blob/master/app/models/compare.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
- expect(get('/gitlab/gitlabhq/blob/master/app/models/diff.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/diff.js')
- expect(get('/gitlab/gitlabhq/blob/master/files.scss')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
- end
-end
-
-# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/}
-describe Projects::TreeController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
- expect(get('/gitlab/gitlabhq/tree/master/files.scss')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
- end
-end
-
-describe Projects::BlobController, 'routing' do
- it 'to #edit' do
- expect(get('/gitlab/gitlabhq/edit/master/app/models/project.rb')).to(
- route_to('projects/blob#edit',
- namespace_id: 'gitlab', project_id: 'gitlabhq',
- id: 'master/app/models/project.rb'))
- end
-
- it 'to #preview' do
- expect(post('/gitlab/gitlabhq/preview/master/app/models/project.rb')).to(
- route_to('projects/blob#preview',
- namespace_id: 'gitlab', project_id: 'gitlabhq',
- id: 'master/app/models/project.rb'))
- end
-end
-
-# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
-# POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/}
-# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
-describe Projects::CompareController, 'routing' do
- it 'to #index' do
- expect(get('/gitlab/gitlabhq/compare')).to route_to('projects/compare#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #compare' do
- expect(post('/gitlab/gitlabhq/compare')).to route_to('projects/compare#create', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/compare/master...stable')).to route_to('projects/compare#show', namespace_id: 'gitlab', project_id: 'gitlabhq', from: 'master', to: 'stable')
- expect(get('/gitlab/gitlabhq/compare/issue/1234...stable')).to route_to('projects/compare#show', namespace_id: 'gitlab', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable')
- end
-end
-
-describe Projects::NetworkController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/network/master')).to route_to('projects/network#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master')
- expect(get('/gitlab/gitlabhq/network/master.json')).to route_to('projects/network#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master', format: 'json')
- end
-end
-
-describe Projects::GraphsController, 'routing' do
- it 'to #show' do
- expect(get('/gitlab/gitlabhq/graphs/master')).to route_to('projects/graphs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master')
- end
-end
-
-describe Projects::ForksController, 'routing' do
- it 'to #new' do
- expect(get('/gitlab/gitlabhq/fork/new')).to route_to('projects/forks#new', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-
- it 'to #create' do
- expect(post('/gitlab/gitlabhq/fork')).to route_to('projects/forks#create', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-end
-
-# project_avatar DELETE /project/avatar(.:format) projects/avatars#destroy
-describe Projects::AvatarsController, 'routing' do
- it 'to #destroy' do
- expect(delete('/gitlab/gitlabhq/avatar')).to route_to(
- 'projects/avatars#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq')
- end
-end
diff --git a/spec/services/archive_repository_service_spec.rb b/spec/services/archive_repository_service_spec.rb
deleted file mode 100644
index f168a9139765de1383df224f2a4696582a6a76a3..0000000000000000000000000000000000000000
--- a/spec/services/archive_repository_service_spec.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-require 'spec_helper'
-
-describe ArchiveRepositoryService do
- let(:project) { create(:project) }
- subject { ArchiveRepositoryService.new(project, "master", "zip") }
-
- describe "#execute" do
- it "cleans old archives" do
- expect(project.repository).to receive(:clean_old_archives)
-
- subject.execute(timeout: 0.0)
- end
-
- context "when the repository doesn't have an archive file path" do
- before do
- allow(project.repository).to receive(:archive_file_path).and_return(nil)
- end
-
- it "raises an error" do
- expect {
- subject.execute(timeout: 0.0)
- }.to raise_error
- end
- end
-
- context "when the repository has an archive file path" do
- let(:file_path) { "/archive.zip" }
- let(:pid_file_path) { "/archive.zip.pid" }
-
- before do
- allow(project.repository).to receive(:archive_file_path).and_return(file_path)
- allow(project.repository).to receive(:archive_pid_file_path).and_return(pid_file_path)
- end
-
- context "when the archive file already exists" do
- before do
- allow(File).to receive(:exist?).with(file_path).and_return(true)
- end
-
- it "returns the file path" do
- expect(subject.execute(timeout: 0.0)).to eq(file_path)
- end
- end
-
- context "when the archive file doesn't exist yet" do
- before do
- allow(File).to receive(:exist?).with(file_path).and_return(false)
- allow(File).to receive(:exist?).with(pid_file_path).and_return(true)
- end
-
- context "when the archive pid file doesn't exist yet" do
- before do
- allow(File).to receive(:exist?).with(pid_file_path).and_return(false)
- end
-
- it "queues the RepositoryArchiveWorker" do
- expect(RepositoryArchiveWorker).to receive(:perform_async)
-
- subject.execute(timeout: 0.0)
- end
- end
-
- context "when the archive pid file already exists" do
- it "doesn't queue the RepositoryArchiveWorker" do
- expect(RepositoryArchiveWorker).not_to receive(:perform_async)
-
- subject.execute(timeout: 0.0)
- end
- end
-
- context "when the archive file exists after a little while" do
- before do
- Thread.new do
- sleep 0.1
- allow(File).to receive(:exist?).with(file_path).and_return(true)
- end
- end
-
- it "returns the file path" do
- expect(subject.execute(timeout: 0.2)).to eq(file_path)
- end
- end
-
- context "when the archive file doesn't exist after the timeout" do
- it "returns nil" do
- expect(subject.execute(timeout: 0.0)).to eq(nil)
- end
- end
- end
- end
- end
-end
-
diff --git a/spec/services/create_snippet_service_spec.rb b/spec/services/create_snippet_service_spec.rb
deleted file mode 100644
index 08689c15ca8ac937677691c73bd00bf21834ba80..0000000000000000000000000000000000000000
--- a/spec/services/create_snippet_service_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-
-describe CreateSnippetService do
- before do
- @user = create :user
- @admin = create :user, admin: true
- @opts = {
- title: 'Test snippet',
- file_name: 'snippet.rb',
- content: 'puts "hello world"',
- visibility_level: Gitlab::VisibilityLevel::PRIVATE
- }
- end
-
- context 'When public visibility is restricted' do
- before do
- allow_any_instance_of(ApplicationSetting).to(
- receive(:restricted_visibility_levels).and_return(
- [Gitlab::VisibilityLevel::PUBLIC]
- )
- )
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'non-admins should not be able to create a public snippet' do
- snippet = create_snippet(nil, @user, @opts)
- expect(snippet.errors.messages).to have_key(:visibility_level)
- expect(snippet.errors.messages[:visibility_level].first).to(
- match('Public visibility has been restricted')
- )
- end
-
- it 'admins should be able to create a public snippet' do
- snippet = create_snippet(nil, @admin, @opts)
- expect(snippet.errors.any?).to be_falsey
- expect(snippet.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
- end
-
- def create_snippet(project, user, opts)
- CreateSnippetService.new(project, user, opts).execute
- end
-end
diff --git a/spec/services/event_create_service_spec.rb b/spec/services/event_create_service_spec.rb
deleted file mode 100644
index 007a9eed192e2ea4c11f89a9c83caca139fe966d..0000000000000000000000000000000000000000
--- a/spec/services/event_create_service_spec.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-require 'spec_helper'
-
-describe EventCreateService do
- let(:service) { EventCreateService.new }
-
- describe 'Issues' do
- describe :open_issue do
- let(:issue) { create(:issue) }
-
- it { expect(service.open_issue(issue, issue.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.open_issue(issue, issue.author) }.to change { Event.count }
- end
- end
-
- describe :close_issue do
- let(:issue) { create(:issue) }
-
- it { expect(service.close_issue(issue, issue.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.close_issue(issue, issue.author) }.to change { Event.count }
- end
- end
-
- describe :reopen_issue do
- let(:issue) { create(:issue) }
-
- it { expect(service.reopen_issue(issue, issue.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.reopen_issue(issue, issue.author) }.to change { Event.count }
- end
- end
- end
-
- describe 'Merge Requests' do
- describe :open_mr do
- let(:merge_request) { create(:merge_request) }
-
- it { expect(service.open_mr(merge_request, merge_request.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.open_mr(merge_request, merge_request.author) }.to change { Event.count }
- end
- end
-
- describe :close_mr do
- let(:merge_request) { create(:merge_request) }
-
- it { expect(service.close_mr(merge_request, merge_request.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.close_mr(merge_request, merge_request.author) }.to change { Event.count }
- end
- end
-
- describe :merge_mr do
- let(:merge_request) { create(:merge_request) }
-
- it { expect(service.merge_mr(merge_request, merge_request.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.merge_mr(merge_request, merge_request.author) }.to change { Event.count }
- end
- end
-
- describe :reopen_mr do
- let(:merge_request) { create(:merge_request) }
-
- it { expect(service.reopen_mr(merge_request, merge_request.author)).to be_truthy }
-
- it "should create new event" do
- expect { service.reopen_mr(merge_request, merge_request.author) }.to change { Event.count }
- end
- end
- end
-
- describe 'Milestone' do
- let(:user) { create :user }
-
- describe :open_milestone do
- let(:milestone) { create(:milestone) }
-
- it { expect(service.open_milestone(milestone, user)).to be_truthy }
-
- it "should create new event" do
- expect { service.open_milestone(milestone, user) }.to change { Event.count }
- end
- end
-
- describe :close_mr do
- let(:milestone) { create(:milestone) }
-
- it { expect(service.close_milestone(milestone, user)).to be_truthy }
-
- it "should create new event" do
- expect { service.close_milestone(milestone, user) }.to change { Event.count }
- end
- end
- end
-end
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb
deleted file mode 100644
index aa9b15dd9ecc1855b112ccb4274964b44c0e3837..0000000000000000000000000000000000000000
--- a/spec/services/git_push_service_spec.rb
+++ /dev/null
@@ -1,238 +0,0 @@
-require 'spec_helper'
-
-describe GitPushService do
- include RepoHelpers
-
- let (:user) { create :user }
- let (:project) { create :project }
- let (:service) { GitPushService.new }
-
- before do
- @blankrev = Gitlab::Git::BLANK_SHA
- @oldrev = sample_commit.parent_id
- @newrev = sample_commit.id
- @ref = 'refs/heads/master'
- end
-
- describe 'Push branches' do
- context 'new branch' do
- subject do
- service.execute(project, user, @blankrev, @newrev, @ref)
- end
-
- it { is_expected.to be_truthy }
- end
-
- context 'existing branch' do
- subject do
- service.execute(project, user, @oldrev, @newrev, @ref)
- end
-
- it { is_expected.to be_truthy }
- end
-
- context 'rm branch' do
- subject do
- service.execute(project, user, @oldrev, @blankrev, @ref)
- end
-
- it { is_expected.to be_truthy }
- end
- end
-
- describe "Git Push Data" do
- before do
- service.execute(project, user, @oldrev, @newrev, @ref)
- @push_data = service.push_data
- @commit = project.repository.commit(@newrev)
- end
-
- subject { @push_data }
-
- it { is_expected.to include(object_kind: 'push') }
- it { is_expected.to include(before: @oldrev) }
- it { is_expected.to include(after: @newrev) }
- it { is_expected.to include(ref: @ref) }
- it { is_expected.to include(user_id: user.id) }
- it { is_expected.to include(user_name: user.name) }
- it { is_expected.to include(project_id: project.id) }
-
- context "with repository data" do
- subject { @push_data[:repository] }
-
- it { is_expected.to include(name: project.name) }
- it { is_expected.to include(url: project.url_to_repo) }
- it { is_expected.to include(description: project.description) }
- it { is_expected.to include(homepage: project.web_url) }
- end
-
- context "with commits" do
- subject { @push_data[:commits] }
-
- it { is_expected.to be_an(Array) }
- it 'has 1 element' do
- expect(subject.size).to eq(1)
- end
-
- context "the commit" do
- subject { @push_data[:commits].first }
-
- it { is_expected.to include(id: @commit.id) }
- it { is_expected.to include(message: @commit.safe_message) }
- it { is_expected.to include(timestamp: @commit.date.xmlschema) }
- it do
- is_expected.to include(
- url: [
- Gitlab.config.gitlab.url,
- project.namespace.to_param,
- project.to_param,
- 'commit',
- @commit.id
- ].join('/')
- )
- end
-
- context "with a author" do
- subject { @push_data[:commits].first[:author] }
-
- it { is_expected.to include(name: @commit.author_name) }
- it { is_expected.to include(email: @commit.author_email) }
- end
- end
- end
- end
-
- describe "Push Event" do
- before do
- service.execute(project, user, @oldrev, @newrev, @ref)
- @event = Event.last
- end
-
- it { expect(@event).not_to be_nil }
- it { expect(@event.project).to eq(project) }
- it { expect(@event.action).to eq(Event::PUSHED) }
- it { expect(@event.data).to eq(service.push_data) }
- end
-
- describe "Web Hooks" do
- context "execute web hooks" do
- it "when pushing a branch for the first time" do
- expect(project).to receive(:execute_hooks)
- expect(project.default_branch).to eq("master")
- expect(project.protected_branches).to receive(:create).with({ name: "master", developers_can_push: false })
- service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master')
- end
-
- it "when pushing a branch for the first time with default branch protection disabled" do
- ApplicationSetting.any_instance.stub(default_branch_protection: 0)
-
- expect(project).to receive(:execute_hooks)
- expect(project.default_branch).to eq("master")
- expect(project.protected_branches).not_to receive(:create)
- service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master')
- end
-
- it "when pushing a branch for the first time with default branch protection set to 'developers can push'" do
- ApplicationSetting.any_instance.stub(default_branch_protection: 1)
-
- expect(project).to receive(:execute_hooks)
- expect(project.default_branch).to eq("master")
- expect(project.protected_branches).to receive(:create).with({ name: "master", developers_can_push: true })
- service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master')
- end
-
- it "when pushing new commits to existing branch" do
- expect(project).to receive(:execute_hooks)
- service.execute(project, user, 'oldrev', 'newrev', 'refs/heads/master')
- end
- end
- end
-
- describe "cross-reference notes" do
- let(:issue) { create :issue, project: project }
- let(:commit_author) { create :user }
- let(:commit) { project.repository.commit }
-
- before do
- commit.stub({
- safe_message: "this commit \n mentions ##{issue.id}",
- references: [issue],
- author_name: commit_author.name,
- author_email: commit_author.email
- })
- project.repository.stub(commits_between: [commit])
- end
-
- it "creates a note if a pushed commit mentions an issue" do
- expect(Note).to receive(:create_cross_reference_note).with(issue, commit, commit_author, project)
-
- service.execute(project, user, @oldrev, @newrev, @ref)
- end
-
- it "only creates a cross-reference note if one doesn't already exist" do
- Note.create_cross_reference_note(issue, commit, user, project)
-
- expect(Note).not_to receive(:create_cross_reference_note).with(issue, commit, commit_author, project)
-
- service.execute(project, user, @oldrev, @newrev, @ref)
- end
-
- it "defaults to the pushing user if the commit's author is not known" do
- commit.stub(author_name: 'unknown name', author_email: 'unknown@email.com')
- expect(Note).to receive(:create_cross_reference_note).with(issue, commit, user, project)
-
- service.execute(project, user, @oldrev, @newrev, @ref)
- end
-
- it "finds references in the first push to a non-default branch" do
- allow(project.repository).to receive(:commits_between).with(@blankrev, @newrev).and_return([])
- allow(project.repository).to receive(:commits_between).with("master", @newrev).and_return([commit])
-
- expect(Note).to receive(:create_cross_reference_note).with(issue, commit, commit_author, project)
-
- service.execute(project, user, @blankrev, @newrev, 'refs/heads/other')
- end
- end
-
- describe "closing issues from pushed commits" do
- let(:issue) { create :issue, project: project }
- let(:other_issue) { create :issue, project: project }
- let(:commit_author) { create :user }
- let(:closing_commit) { project.repository.commit }
-
- before do
- closing_commit.stub({
- issue_closing_regex: /^([Cc]loses|[Ff]ixes) #\d+/,
- safe_message: "this is some work.\n\ncloses ##{issue.iid}",
- author_name: commit_author.name,
- author_email: commit_author.email
- })
-
- project.repository.stub(commits_between: [closing_commit])
- end
-
- it "closes issues with commit messages" do
- service.execute(project, user, @oldrev, @newrev, @ref)
-
- expect(Issue.find(issue.id)).to be_closed
- end
-
- it "doesn't create cross-reference notes for a closing reference" do
- expect {
- service.execute(project, user, @oldrev, @newrev, @ref)
- }.not_to change { Note.where(project_id: project.id, system: true, commit_id: closing_commit.id).count }
- end
-
- it "doesn't close issues when pushed to non-default branches" do
- project.stub(default_branch: 'durf')
-
- # The push still shouldn't create cross-reference notes.
- expect {
- service.execute(project, user, @oldrev, @newrev, 'refs/heads/hurf')
- }.not_to change { Note.where(project_id: project.id, system: true).count }
-
- expect(Issue.find(issue.id)).to be_opened
- end
- end
-end
-
diff --git a/spec/services/git_tag_push_service_spec.rb b/spec/services/git_tag_push_service_spec.rb
deleted file mode 100644
index a050fdf6c0eb1ac58e08a7243c49d2c76c45db22..0000000000000000000000000000000000000000
--- a/spec/services/git_tag_push_service_spec.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-require 'spec_helper'
-
-describe GitTagPushService do
- include RepoHelpers
-
- let (:user) { create :user }
- let (:project) { create :project }
- let (:service) { GitTagPushService.new }
-
- before do
- @oldrev = Gitlab::Git::BLANK_SHA
- @newrev = "8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b" # gitlab-test: git rev-parse refs/tags/v1.1.0
- @ref = 'refs/tags/v1.1.0'
- end
-
- describe "Git Tag Push Data" do
- before do
- service.execute(project, user, @oldrev, @newrev, @ref)
- @push_data = service.push_data
- @tag_name = Gitlab::Git.ref_name(@ref)
- @tag = project.repository.find_tag(@tag_name)
- @commit = project.repository.commit(@tag.target)
- end
-
- subject { @push_data }
-
- it { is_expected.to include(object_kind: 'tag_push') }
- it { is_expected.to include(ref: @ref) }
- it { is_expected.to include(before: @oldrev) }
- it { is_expected.to include(after: @newrev) }
- it { is_expected.to include(message: @tag.message) }
- it { is_expected.to include(user_id: user.id) }
- it { is_expected.to include(user_name: user.name) }
- it { is_expected.to include(project_id: project.id) }
-
- context "with repository data" do
- subject { @push_data[:repository] }
-
- it { is_expected.to include(name: project.name) }
- it { is_expected.to include(url: project.url_to_repo) }
- it { is_expected.to include(description: project.description) }
- it { is_expected.to include(homepage: project.web_url) }
- end
-
- context "with commits" do
- subject { @push_data[:commits] }
-
- it { is_expected.to be_an(Array) }
- it 'has 1 element' do
- expect(subject.size).to eq(1)
- end
-
- context "the commit" do
- subject { @push_data[:commits].first }
-
- it { is_expected.to include(id: @commit.id) }
- it { is_expected.to include(message: @commit.safe_message) }
- it { is_expected.to include(timestamp: @commit.date.xmlschema) }
- it do
- is_expected.to include(
- url: [
- Gitlab.config.gitlab.url,
- project.namespace.to_param,
- project.to_param,
- 'commit',
- @commit.id
- ].join('/')
- )
- end
-
- context "with a author" do
- subject { @push_data[:commits].first[:author] }
-
- it { is_expected.to include(name: @commit.author_name) }
- it { is_expected.to include(email: @commit.author_email) }
- end
- end
- end
- end
-
- describe "Web Hooks" do
- context "execute web hooks" do
- it "when pushing tags" do
- expect(project).to receive(:execute_hooks)
- service.execute(project, user, 'oldrev', 'newrev', 'refs/tags/v1.0.0')
- end
- end
- end
-end
diff --git a/spec/services/issues/bulk_update_service_spec.rb b/spec/services/issues/bulk_update_service_spec.rb
deleted file mode 100644
index a97c55011c91e8a4db4839a925f618eb6143af0f..0000000000000000000000000000000000000000
--- a/spec/services/issues/bulk_update_service_spec.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require 'spec_helper'
-
-describe Issues::BulkUpdateService do
- let(:issue) {
- create(:issue, project: @project)
- }
-
- before do
- @user = create :user
- opts = {
- name: "GitLab",
- namespace: @user.namespace
- }
- @project = Projects::CreateService.new(@user, opts).execute
- end
-
- describe :close_issue do
-
- before do
- @issues = 5.times.collect do
- create(:issue, project: @project)
- end
- @params = {
- state_event: 'close',
- issues_ids: @issues.map(&:id)
- }
- end
-
- it {
- result = Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(@issues.count)
-
- expect(@project.issues.opened).to be_empty
- expect(@project.issues.closed).not_to be_empty
- }
-
- end
-
- describe :reopen_issues do
-
- before do
- @issues = 5.times.collect do
- create(:closed_issue, project: @project)
- end
- @params = {
- state_event: 'reopen',
- issues_ids: @issues.map(&:id)
- }
- end
-
- it {
- result = Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(@issues.count)
-
- expect(@project.issues.closed).to be_empty
- expect(@project.issues.opened).not_to be_empty
- }
-
- end
-
- describe :update_assignee do
-
- before do
- @new_assignee = create :user
- @params = {
- issues_ids: [issue.id],
- assignee_id: @new_assignee.id
- }
- end
-
- it {
- result = Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(1)
-
- expect(@project.issues.first.assignee).to eq(@new_assignee)
- }
-
- it 'allows mass-unassigning' do
- @project.issues.first.update_attribute(:assignee, @new_assignee)
- expect(@project.issues.first.assignee).not_to be_nil
-
- @params[:assignee_id] = -1
-
- Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(@project.issues.first.assignee).to be_nil
- end
-
- it 'does not unassign when assignee_id is not present' do
- @project.issues.first.update_attribute(:assignee, @new_assignee)
- expect(@project.issues.first.assignee).not_to be_nil
-
- @params[:assignee_id] = ''
-
- Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(@project.issues.first.assignee).not_to be_nil
- end
- end
-
- describe :update_milestone do
-
- before do
- @milestone = create :milestone
- @params = {
- issues_ids: [issue.id],
- milestone_id: @milestone.id
- }
- end
-
- it {
- result = Issues::BulkUpdateService.new(@project, @user, @params).execute
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(1)
-
- expect(@project.issues.first.milestone).to eq(@milestone)
- }
- end
-
-end
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb
deleted file mode 100644
index d15dff1b52b24e1f17f8084d238b8151316eaacc..0000000000000000000000000000000000000000
--- a/spec/services/issues/close_service_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'spec_helper'
-
-describe Issues::CloseService do
- let(:project) { create(:empty_project) }
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:issue) { create(:issue, assignee: user2) }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context "valid params" do
- before do
- @issue = Issues::CloseService.new(project, user, {}).execute(issue)
- end
-
- it { expect(@issue).to be_valid }
- it { expect(@issue).to be_closed }
-
- it 'should send email to user2 about assign of new issue' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(issue.title)
- end
-
- it 'should create system note about issue reassign' do
- note = @issue.notes.last
- expect(note.note).to include "Status changed to closed"
- end
- end
- end
-end
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb
deleted file mode 100644
index 7f1ebcb319897ce69b965524670ddadbc385666d..0000000000000000000000000000000000000000
--- a/spec/services/issues/create_service_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'spec_helper'
-
-describe Issues::CreateService do
- let(:project) { create(:empty_project) }
- let(:user) { create(:user) }
-
- describe :execute do
- context "valid params" do
- before do
- project.team << [user, :master]
- opts = {
- title: 'Awesome issue',
- description: 'please fix'
- }
-
- @issue = Issues::CreateService.new(project, user, opts).execute
- end
-
- it { expect(@issue).to be_valid }
- it { expect(@issue.title).to eq('Awesome issue') }
- end
- end
-end
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb
deleted file mode 100644
index 22b89bec96d0e032ecf6bdc6e0a404186fe7c008..0000000000000000000000000000000000000000
--- a/spec/services/issues/update_service_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'spec_helper'
-
-describe Issues::UpdateService do
- let(:project) { create(:empty_project) }
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:issue) { create(:issue) }
- let(:label) { create(:label) }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context "valid params" do
- before do
- opts = {
- title: 'New title',
- description: 'Also please fix',
- assignee_id: user2.id,
- state_event: 'close',
- label_ids: [label.id]
- }
-
- @issue = Issues::UpdateService.new(project, user, opts).execute(issue)
- @issue.reload
- end
-
- it { expect(@issue).to be_valid }
- it { expect(@issue.title).to eq('New title') }
- it { expect(@issue.assignee).to eq(user2) }
- it { expect(@issue).to be_closed }
- it { expect(@issue.labels.count).to eq(1) }
- it { expect(@issue.labels.first.title).to eq('Bug') }
-
- it 'should send email to user2 about assign of new issue' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(issue.title)
- end
-
- it 'should create system note about issue reassign' do
- note = @issue.notes.last
- expect(note.note).to include "Reassigned to \@#{user2.username}"
- end
-
- it 'should create system note about issue label edit' do
- note = @issue.notes[1]
- expect(note.note).to include "Added ~#{label.id} label"
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb
deleted file mode 100644
index b3cbfd4b5b8d8e9074b186300d10f41191a1a2cd..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/close_service_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::CloseService do
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:merge_request) { create(:merge_request, assignee: user2) }
- let(:project) { merge_request.project }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context 'valid params' do
- let(:service) { MergeRequests::CloseService.new(project, user, {}) }
-
- before do
- allow(service).to receive(:execute_hooks)
-
- @merge_request = service.execute(merge_request)
- end
-
- it { expect(@merge_request).to be_valid }
- it { expect(@merge_request).to be_closed }
-
- it 'should execute hooks with close action' do
- expect(service).to have_received(:execute_hooks).
- with(@merge_request, 'close')
- end
-
- it 'should send email to user2 about assign of new merge_request' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(merge_request.title)
- end
-
- it 'should create system note about merge_request reassign' do
- note = @merge_request.notes.last
- expect(note.note).to include 'Status changed to closed'
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/create_service_spec.rb b/spec/services/merge_requests/create_service_spec.rb
deleted file mode 100644
index d9bfdf643080752f3ede55ae554b7f590ba8d3c3..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/create_service_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::CreateService do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
-
- describe :execute do
- context 'valid params' do
- let(:opts) do
- {
- title: 'Awesome merge_request',
- description: 'please fix',
- source_branch: 'stable',
- target_branch: 'master'
- }
- end
- let(:service) { MergeRequests::CreateService.new(project, user, opts) }
-
- before do
- project.team << [user, :master]
- allow(service).to receive(:execute_hooks)
-
- @merge_request = service.execute
- end
-
- it { expect(@merge_request).to be_valid }
- it { expect(@merge_request.title).to eq('Awesome merge_request') }
-
- it 'should execute hooks with default action' do
- expect(service).to have_received(:execute_hooks).with(@merge_request)
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb
deleted file mode 100644
index 0a25fb12f4eaa34e964f97349fa7cb5d9ff197f3..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/merge_service_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::MergeService do
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:merge_request) { create(:merge_request, assignee: user2) }
- let(:project) { merge_request.project }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context 'valid params' do
- let(:service) { MergeRequests::MergeService.new(project, user, {}) }
-
- before do
- allow(service).to receive(:execute_hooks)
-
- service.execute(merge_request, 'Awesome message')
- end
-
- it { expect(merge_request).to be_valid }
- it { expect(merge_request).to be_merged }
-
- it 'should execute hooks with merge action' do
- expect(service).to have_received(:execute_hooks).
- with(merge_request, 'merge')
- end
-
- it 'should send email to user2 about merge of new merge_request' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(merge_request.title)
- end
-
- it 'should create system note about merge_request merge' do
- note = merge_request.notes.last
- expect(note.note).to include 'Status changed to merged'
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb
deleted file mode 100644
index 879df0c9c67655bfcf7880aab8c7e5cffe8bc0ac..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/refresh_service_spec.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::RefreshService do
- let(:project) { create(:project) }
- let(:user) { create(:user) }
- let(:service) { MergeRequests::RefreshService }
-
- describe :execute do
- before do
- @user = create(:user)
- group = create(:group)
- group.add_owner(@user)
-
- @project = create(:project, namespace: group)
- @fork_project = Projects::ForkService.new(@project, @user).execute
- @merge_request = create(:merge_request, source_project: @project,
- source_branch: 'master',
- target_branch: 'feature',
- target_project: @project)
-
- @fork_merge_request = create(:merge_request, source_project: @fork_project,
- source_branch: 'master',
- target_branch: 'feature',
- target_project: @project)
-
- @commits = @merge_request.commits
-
- @oldrev = @commits.last.id
- @newrev = @commits.first.id
- end
-
- context 'push to origin repo source branch' do
- before do
- service.new(@project, @user).execute(@oldrev, @newrev, 'refs/heads/master')
- reload_mrs
- end
-
- it { expect(@merge_request.notes).not_to be_empty }
- it { expect(@merge_request).to be_open }
- it { expect(@fork_merge_request).to be_open }
- it { expect(@fork_merge_request.notes).to be_empty }
- end
-
- context 'push to origin repo target branch' do
- before do
- service.new(@project, @user).execute(@oldrev, @newrev, 'refs/heads/feature')
- reload_mrs
- end
-
- it { expect(@merge_request.notes.last.note).to include('changed to merged') }
- it { expect(@merge_request).to be_merged }
- it { expect(@fork_merge_request).to be_merged }
- it { expect(@fork_merge_request.notes.last.note).to include('changed to merged') }
- end
-
- context 'push to fork repo source branch' do
- before do
- service.new(@fork_project, @user).execute(@oldrev, @newrev, 'refs/heads/master')
- reload_mrs
- end
-
- it { expect(@merge_request.notes).to be_empty }
- it { expect(@merge_request).to be_open }
- it { expect(@fork_merge_request.notes.last.note).to include('Added 4 commits') }
- it { expect(@fork_merge_request).to be_open }
- end
-
- context 'push to fork repo target branch' do
- before do
- service.new(@fork_project, @user).execute(@oldrev, @newrev, 'refs/heads/feature')
- reload_mrs
- end
-
- it { expect(@merge_request.notes).to be_empty }
- it { expect(@merge_request).to be_open }
- it { expect(@fork_merge_request.notes).to be_empty }
- it { expect(@fork_merge_request).to be_open }
- end
-
- context 'push to origin repo target branch after fork project was removed' do
- before do
- @fork_project.destroy
- service.new(@project, @user).execute(@oldrev, @newrev, 'refs/heads/feature')
- reload_mrs
- end
-
- it { expect(@merge_request.notes.last.note).to include('changed to merged') }
- it { expect(@merge_request).to be_merged }
- it { expect(@fork_merge_request).to be_open }
- it { expect(@fork_merge_request.notes).to be_empty }
- end
-
- def reload_mrs
- @merge_request.reload
- @fork_merge_request.reload
- end
- end
-end
diff --git a/spec/services/merge_requests/reopen_service_spec.rb b/spec/services/merge_requests/reopen_service_spec.rb
deleted file mode 100644
index 9401bc3b55893ab47e734083b10d2dbd6cead703..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/reopen_service_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::ReopenService do
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:merge_request) { create(:merge_request, assignee: user2) }
- let(:project) { merge_request.project }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context 'valid params' do
- let(:service) { MergeRequests::ReopenService.new(project, user, {}) }
-
- before do
- allow(service).to receive(:execute_hooks)
-
- merge_request.state = :closed
- service.execute(merge_request)
- end
-
- it { expect(merge_request).to be_valid }
- it { expect(merge_request).to be_reopened }
-
- it 'should execute hooks with reopen action' do
- expect(service).to have_received(:execute_hooks).
- with(merge_request, 'reopen')
- end
-
- it 'should send email to user2 about reopen of merge_request' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(merge_request.title)
- end
-
- it 'should create system note about merge_request reopen' do
- note = merge_request.notes.last
- expect(note.note).to include 'Status changed to reopened'
- end
- end
- end
-end
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb
deleted file mode 100644
index 916b01e1c45e4a84403f52626623dd529ab9837e..0000000000000000000000000000000000000000
--- a/spec/services/merge_requests/update_service_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe MergeRequests::UpdateService do
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:merge_request) { create(:merge_request, :simple) }
- let(:project) { merge_request.project }
- let(:label) { create(:label) }
-
- before do
- project.team << [user, :master]
- project.team << [user2, :developer]
- end
-
- describe :execute do
- context 'valid params' do
- let(:opts) do
- {
- title: 'New title',
- description: 'Also please fix',
- assignee_id: user2.id,
- state_event: 'close',
- label_ids: [label.id]
- }
- end
-
- let(:service) { MergeRequests::UpdateService.new(project, user, opts) }
-
- before do
- allow(service).to receive(:execute_hooks)
-
- @merge_request = service.execute(merge_request)
- @merge_request.reload
- end
-
- it { expect(@merge_request).to be_valid }
- it { expect(@merge_request.title).to eq('New title') }
- it { expect(@merge_request.assignee).to eq(user2) }
- it { expect(@merge_request).to be_closed }
- it { expect(@merge_request.labels.count).to eq(1) }
- it { expect(@merge_request.labels.first.title).to eq('Bug') }
-
- it 'should execute hooks with update action' do
- expect(service).to have_received(:execute_hooks).
- with(@merge_request, 'update')
- end
-
- it 'should send email to user2 about assign of new merge_request' do
- email = ActionMailer::Base.deliveries.last
- expect(email.to.first).to eq(user2.email)
- expect(email.subject).to include(merge_request.title)
- end
-
- it 'should create system note about merge_request reassign' do
- note = @merge_request.notes.last
- expect(note.note).to include "Reassigned to \@#{user2.username}"
- end
-
- it 'should create system note about merge_request label edit' do
- note = @merge_request.notes[1]
- expect(note.note).to include "Added ~#{label.id} label"
- end
- end
- end
-end
diff --git a/spec/services/milestones/group_service_spec.rb b/spec/services/milestones/group_service_spec.rb
deleted file mode 100644
index 74eb0f99e0f29e713c49fd27945bf573fbf13816..0000000000000000000000000000000000000000
--- a/spec/services/milestones/group_service_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'spec_helper'
-
-describe Milestones::GroupService do
- let(:user) { create(:user) }
- let(:user2) { create(:user) }
- let(:group) { create(:group) }
- let(:project1) { create(:project, group: group) }
- let(:project2) { create(:project, path: 'gitlab-ci', group: group) }
- let(:project3) { create(:project, path: 'cookbook-gitlab', group: group) }
- let(:milestone1_project1) { create(:milestone, title: "Milestone v1.2", project: project1) }
- let(:milestone1_project2) { create(:milestone, title: "Milestone v1.2", project: project2) }
- let(:milestone1_project3) { create(:milestone, title: "Milestone v1.2", project: project3) }
- let(:milestone2_project1) { create(:milestone, title: "VD-123", project: project1) }
- let(:milestone2_project2) { create(:milestone, title: "VD-123", project: project2) }
- let(:milestone2_project3) { create(:milestone, title: "VD-123", project: project3) }
-
- describe 'execute' do
- context 'with valid projects' do
- before do
- milestones =
- [
- milestone1_project1,
- milestone1_project2,
- milestone1_project3,
- milestone2_project1,
- milestone2_project2,
- milestone2_project3
- ]
- @group_milestones = Milestones::GroupService.new(milestones).execute
- end
-
- it 'should have all project milestones' do
- expect(@group_milestones.count).to eq(2)
- end
-
- it 'should have all project milestones titles' do
- expect(@group_milestones.map { |group_milestone| group_milestone.title }).to match_array(['Milestone v1.2', 'VD-123'])
- end
-
- it 'should have all project milestones' do
- expect(@group_milestones.map { |group_milestone| group_milestone.milestones.count }.sum).to eq(6)
- end
- end
- end
-
- describe 'milestone' do
- context 'with valid title' do
- before do
- milestones =
- [
- milestone1_project1,
- milestone1_project2,
- milestone1_project3,
- milestone2_project1,
- milestone2_project2,
- milestone2_project3
- ]
- @group_milestones = Milestones::GroupService.new(milestones).milestone('Milestone v1.2')
- end
-
- it 'should have exactly one group milestone' do
- expect(@group_milestones.title).to eq('Milestone v1.2')
- end
-
- it 'should have all project milestones with the same title' do
- expect(@group_milestones.milestones.count).to eq(3)
- end
- end
- end
-end
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb
deleted file mode 100644
index 1a02299bf19c5f4b247d134b56c589396767ca43..0000000000000000000000000000000000000000
--- a/spec/services/notes/create_service_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-
-describe Notes::CreateService do
- let(:project) { create(:empty_project) }
- let(:issue) { create(:issue, project: project) }
- let(:user) { create(:user) }
-
- describe :execute do
- context "valid params" do
- before do
- project.team << [user, :master]
- opts = {
- note: 'Awesome comment',
- noteable_type: 'Issue',
- noteable_id: issue.id
- }
-
- @note = Notes::CreateService.new(project, user, opts).execute
- end
-
- it { expect(@note).to be_valid }
- it { expect(@note.note).to eq('Awesome comment') }
- end
- end
-end
-
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
deleted file mode 100644
index bfca2c88264354f7aca3f3abd5c06579ec18ccc0..0000000000000000000000000000000000000000
--- a/spec/services/notification_service_spec.rb
+++ /dev/null
@@ -1,455 +0,0 @@
-require 'spec_helper'
-
-describe NotificationService do
- let(:notification) { NotificationService.new }
-
- describe 'Keys' do
- describe :new_key do
- let!(:key) { create(:personal_key) }
-
- it { expect(notification.new_key(key)).to be_truthy }
-
- it 'should sent email to key owner' do
- expect(Notify).to receive(:new_ssh_key_email).with(key.id)
- notification.new_key(key)
- end
- end
- end
-
- describe 'Email' do
- describe :new_email do
- let!(:email) { create(:email) }
-
- it { expect(notification.new_email(email)).to be_truthy }
-
- it 'should send email to email owner' do
- expect(Notify).to receive(:new_email_email).with(email.id)
- notification.new_email(email)
- end
- end
- end
-
- describe 'Notes' do
- context 'issue note' do
- let(:issue) { create(:issue, assignee: create(:user)) }
- let(:mentioned_issue) { create(:issue, assignee: issue.assignee) }
- let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced') }
-
- before do
- build_team(note.project)
- end
-
- describe :new_note do
- it do
- add_users_with_subscription(note.project, issue)
-
- should_email(@u_watcher.id)
- should_email(note.noteable.author_id)
- should_email(note.noteable.assignee_id)
- should_email(@u_mentioned.id)
- should_email(@subscriber.id)
- should_not_email(note.author_id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- should_not_email(@unsubscriber.id)
-
- notification.new_note(note)
- end
-
- it 'filters out "mentioned in" notes' do
- mentioned_note = Note.create_cross_reference_note(mentioned_issue, issue, issue.author, issue.project)
-
- expect(Notify).not_to receive(:note_issue_email)
- notification.new_note(mentioned_note)
- end
- end
-
- describe 'new note on issue in project that belongs to a group' do
- let(:group) { create(:group) }
-
- before do
- note.project.namespace_id = group.id
- note.project.group.add_user(@u_watcher, GroupMember::MASTER)
- note.project.save
- user_project = note.project.project_members.find_by_user_id(@u_watcher.id)
- user_project.notification_level = Notification::N_PARTICIPATING
- user_project.save
- group_member = note.project.group.group_members.find_by_user_id(@u_watcher.id)
- group_member.notification_level = Notification::N_GLOBAL
- group_member.save
- end
-
- it do
- should_email(note.noteable.author_id)
- should_email(note.noteable.assignee_id)
- should_email(@u_mentioned.id)
- should_not_email(@u_watcher.id)
- should_not_email(note.author_id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.new_note(note)
- end
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:note_issue_email).with(user_id, note.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:note_issue_email).with(user_id, note.id)
- end
- end
-
- context 'issue note mention' do
- let(:issue) { create(:issue, assignee: create(:user)) }
- let(:mentioned_issue) { create(:issue, assignee: issue.assignee) }
- let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@all mentioned') }
-
- before do
- build_team(note.project)
- end
-
- describe :new_note do
- it do
- # Notify all team members
- note.project.team.members.each do |member|
- # User with disabled notification should not be notified
- next if member.id == @u_disabled.id
- should_email(member.id)
- end
- should_email(note.noteable.author_id)
- should_email(note.noteable.assignee_id)
-
- should_not_email(note.author_id)
- should_not_email(@u_mentioned.id)
- should_not_email(@u_disabled.id)
- should_not_email(@u_not_mentioned.id)
- notification.new_note(note)
- end
-
- it 'filters out "mentioned in" notes' do
- mentioned_note = Note.create_cross_reference_note(mentioned_issue, issue, issue.author, issue.project)
-
- expect(Notify).not_to receive(:note_issue_email)
- notification.new_note(mentioned_note)
- end
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:note_issue_email).with(user_id, note.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:note_issue_email).with(user_id, note.id)
- end
- end
-
- context 'commit note' do
- let(:note) { create(:note_on_commit) }
-
- before do
- build_team(note.project)
- note.stub(:commit_author => @u_committer)
- end
-
- describe :new_note do
- it do
- should_email(@u_committer.id, note)
- should_email(@u_watcher.id, note)
- should_not_email(@u_mentioned.id, note)
- should_not_email(note.author_id, note)
- should_not_email(@u_participating.id, note)
- should_not_email(@u_disabled.id, note)
- notification.new_note(note)
- end
-
- it do
- note.update_attribute(:note, '@mention referenced')
- should_email(@u_committer.id, note)
- should_email(@u_watcher.id, note)
- should_email(@u_mentioned.id, note)
- should_not_email(note.author_id, note)
- should_not_email(@u_participating.id, note)
- should_not_email(@u_disabled.id, note)
- notification.new_note(note)
- end
-
- it do
- @u_committer.update_attributes(notification_level: Notification::N_MENTION)
- should_not_email(@u_committer.id, note)
- notification.new_note(note)
- end
-
- def should_email(user_id, n)
- expect(Notify).to receive(:note_commit_email).with(user_id, n.id)
- end
-
- def should_not_email(user_id, n)
- expect(Notify).not_to receive(:note_commit_email).with(user_id, n.id)
- end
- end
- end
- end
-
- describe 'Issues' do
- let(:issue) { create :issue, assignee: create(:user), description: 'cc @participant' }
-
- before do
- build_team(issue.project)
- add_users_with_subscription(issue.project, issue)
- end
-
- describe :new_issue do
- it do
- should_email(issue.assignee_id)
- should_email(@u_watcher.id)
- should_email(@u_participant_mentioned.id)
- should_not_email(@u_mentioned.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.new_issue(issue, @u_disabled)
- end
-
- it do
- issue.assignee.update_attributes(notification_level: Notification::N_MENTION)
- should_not_email(issue.assignee_id)
- notification.new_issue(issue, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:new_issue_email).with(user_id, issue.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:new_issue_email).with(user_id, issue.id)
- end
- end
-
- describe :reassigned_issue do
- it 'should email new assignee' do
- should_email(issue.assignee_id)
- should_email(@u_watcher.id)
- should_email(@u_participant_mentioned.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
-
- notification.reassigned_issue(issue, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:reassigned_issue_email).with(user_id, issue.id, nil, @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:reassigned_issue_email).with(user_id, issue.id, issue.assignee_id, @u_disabled.id)
- end
- end
-
- describe :close_issue do
- it 'should sent email to issue assignee and issue author' do
- should_email(issue.assignee_id)
- should_email(issue.author_id)
- should_email(@u_watcher.id)
- should_email(@u_participant_mentioned.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
-
- notification.close_issue(issue, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:closed_issue_email).with(user_id, issue.id, @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:closed_issue_email).with(user_id, issue.id, @u_disabled.id)
- end
- end
-
- describe :reopen_issue do
- it 'should send email to issue assignee and issue author' do
- should_email(issue.assignee_id)
- should_email(issue.author_id)
- should_email(@u_watcher.id)
- should_email(@u_participant_mentioned.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
-
- notification.reopen_issue(issue, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:issue_status_changed_email).with(user_id, issue.id, 'reopened', @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:issue_status_changed_email).with(user_id, issue.id, 'reopened', @u_disabled.id)
- end
- end
- end
-
- describe 'Merge Requests' do
- let(:merge_request) { create :merge_request, assignee: create(:user) }
-
- before do
- build_team(merge_request.target_project)
- add_users_with_subscription(merge_request.target_project, merge_request)
- end
-
- describe :new_merge_request do
- it do
- should_email(merge_request.assignee_id)
- should_email(@u_watcher.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.new_merge_request(merge_request, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:new_merge_request_email).with(user_id, merge_request.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:new_merge_request_email).with(user_id, merge_request.id)
- end
- end
-
- describe :reassigned_merge_request do
- it do
- should_email(merge_request.assignee_id)
- should_email(@u_watcher.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.reassigned_merge_request(merge_request, merge_request.author)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:reassigned_merge_request_email).with(user_id, merge_request.id, nil, merge_request.author_id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:reassigned_merge_request_email).with(user_id, merge_request.id, merge_request.assignee_id, merge_request.author_id)
- end
- end
-
- describe :closed_merge_request do
- it do
- should_email(merge_request.assignee_id)
- should_email(@u_watcher.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.close_mr(merge_request, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:closed_merge_request_email).with(user_id, merge_request.id, @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:closed_merge_request_email).with(user_id, merge_request.id, @u_disabled.id)
- end
- end
-
- describe :merged_merge_request do
- it do
- should_email(merge_request.assignee_id)
- should_email(@u_watcher.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.merge_mr(merge_request, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:merged_merge_request_email).with(user_id, merge_request.id, @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:merged_merge_request_email).with(user_id, merge_request.id, @u_disabled.id)
- end
- end
-
- describe :reopen_merge_request do
- it do
- should_email(merge_request.assignee_id)
- should_email(@u_watcher.id)
- should_email(@subscriber.id)
- should_not_email(@unsubscriber.id)
- should_not_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.reopen_mr(merge_request, @u_disabled)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:merge_request_status_email).with(user_id, merge_request.id, 'reopened', @u_disabled.id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:merge_request_status_email).with(user_id, merge_request.id, 'reopened', @u_disabled.id)
- end
- end
- end
-
- describe 'Projects' do
- let(:project) { create :project }
-
- before do
- build_team(project)
- end
-
- describe :project_was_moved do
- it do
- should_email(@u_watcher.id)
- should_email(@u_participating.id)
- should_not_email(@u_disabled.id)
- notification.project_was_moved(project)
- end
-
- def should_email(user_id)
- expect(Notify).to receive(:project_was_moved_email).with(project.id, user_id)
- end
-
- def should_not_email(user_id)
- expect(Notify).not_to receive(:project_was_moved_email).with(project.id, user_id)
- end
- end
- end
-
- def build_team(project)
- @u_watcher = create(:user, notification_level: Notification::N_WATCH)
- @u_participating = create(:user, notification_level: Notification::N_PARTICIPATING)
- @u_participant_mentioned = create(:user, username: 'participant', notification_level: Notification::N_PARTICIPATING)
- @u_disabled = create(:user, notification_level: Notification::N_DISABLED)
- @u_mentioned = create(:user, username: 'mention', notification_level: Notification::N_MENTION)
- @u_committer = create(:user, username: 'committer')
- @u_not_mentioned = create(:user, username: 'regular', notification_level: Notification::N_PARTICIPATING)
-
- project.team << [@u_watcher, :master]
- project.team << [@u_participating, :master]
- project.team << [@u_disabled, :master]
- project.team << [@u_mentioned, :master]
- project.team << [@u_committer, :master]
- end
-
- def add_users_with_subscription(project, issuable)
- @subscriber = create :user
- @unsubscriber = create :user
-
- project.team << [@subscriber, :master]
- project.team << [@unsubscriber, :master]
-
- issuable.subscriptions.create(user: @subscriber, subscribed: true)
- issuable.subscriptions.create(user: @unsubscriber, subscribed: false)
- end
-end
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb
deleted file mode 100644
index 337dae592dd488024653093b2c918ec94880c2bc..0000000000000000000000000000000000000000
--- a/spec/services/projects/create_service_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'spec_helper'
-
-describe Projects::CreateService do
- describe :create_by_user do
- before do
- @user = create :user
- @admin = create :user, admin: true
- @opts = {
- name: "GitLab",
- namespace: @user.namespace
- }
- end
-
- context 'user namespace' do
- before do
- @project = create_project(@user, @opts)
- end
-
- it { expect(@project).to be_valid }
- it { expect(@project.owner).to eq(@user) }
- it { expect(@project.namespace).to eq(@user.namespace) }
- end
-
- context 'group namespace' do
- before do
- @group = create :group
- @group.add_owner(@user)
-
- @opts.merge!(namespace_id: @group.id)
- @project = create_project(@user, @opts)
- end
-
- it { expect(@project).to be_valid }
- it { expect(@project.owner).to eq(@group) }
- it { expect(@project.namespace).to eq(@group) }
- end
-
- context 'wiki_enabled creates repository directory' do
- context 'wiki_enabled true creates wiki repository directory' do
- before do
- @project = create_project(@user, @opts)
- @path = ProjectWiki.new(@project, @user).send(:path_to_repo)
- end
-
- it { expect(File.exists?(@path)).to be_truthy }
- end
-
- context 'wiki_enabled false does not create wiki repository directory' do
- before do
- @opts.merge!(wiki_enabled: false)
- @project = create_project(@user, @opts)
- @path = ProjectWiki.new(@project, @user).send(:path_to_repo)
- end
-
- it { expect(File.exists?(@path)).to be_falsey }
- end
- end
-
- context 'restricted visibility level' do
- before do
- allow_any_instance_of(ApplicationSetting).to(
- receive(:restricted_visibility_levels).and_return([20])
- )
-
- @opts.merge!(
- visibility_level: Gitlab::VisibilityLevel.options['Public']
- )
- end
-
- it 'should not allow a restricted visibility level for non-admins' do
- project = create_project(@user, @opts)
- expect(project).to respond_to(:errors)
- expect(project.errors.messages).to have_key(:visibility_level)
- expect(project.errors.messages[:visibility_level].first).to(
- match('restricted by your GitLab administrator')
- )
- end
-
- it 'should allow a restricted visibility level for admins' do
- project = create_project(@admin, @opts)
- expect(project.errors.any?).to be(false)
- expect(project.saved?).to be(true)
- end
- end
- end
-
- def create_project(user, opts)
- Projects::CreateService.new(user, opts).execute
- end
-end
diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb
deleted file mode 100644
index c9025bdf133087619ec0999f79e543db7d51b97e..0000000000000000000000000000000000000000
--- a/spec/services/projects/fork_service_spec.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require 'spec_helper'
-
-describe Projects::ForkService do
- describe :fork_by_user do
- before do
- @from_namespace = create(:namespace)
- @from_user = create(:user, namespace: @from_namespace )
- @from_project = create(:project, creator_id: @from_user.id,
- namespace: @from_namespace, star_count: 107,
- description: 'wow such project')
- @to_namespace = create(:namespace)
- @to_user = create(:user, namespace: @to_namespace)
- end
-
- context 'fork project' do
- describe "successfully creates project in the user namespace" do
- let(:to_project) { fork_project(@from_project, @to_user) }
-
- it { expect(to_project.owner).to eq(@to_user) }
- it { expect(to_project.namespace).to eq(@to_user.namespace) }
- it { expect(to_project.star_count).to be_zero }
- it { expect(to_project.description).to eq(@from_project.description) }
- end
- end
-
- context 'fork project failure' do
- it "fails due to transaction failure" do
- @to_project = fork_project(@from_project, @to_user, false)
- expect(@to_project.errors).not_to be_empty
- expect(@to_project.errors[:base]).to include("Fork transaction failed.")
- end
- end
-
- context 'project already exists' do
- it "should fail due to validation, not transaction failure" do
- @existing_project = create(:project, creator_id: @to_user.id, name: @from_project.name, namespace: @to_namespace)
- @to_project = fork_project(@from_project, @to_user)
- expect(@existing_project.persisted?).to be_truthy
- expect(@to_project.errors[:base]).to include("Invalid fork destination")
- expect(@to_project.errors[:base]).not_to include("Fork transaction failed.")
- end
- end
-
- context 'GitLab CI is enabled' do
- it "calls fork registrator for CI" do
- @from_project.build_missing_services
- @from_project.gitlab_ci_service.update_attributes(active: true)
-
- expect(ForkRegistrationWorker).to receive(:perform_async)
-
- fork_project(@from_project, @to_user)
- end
- end
- end
-
- describe :fork_to_namespace do
- before do
- @group_owner = create(:user)
- @developer = create(:user)
- @project = create(:project, creator_id: @group_owner.id,
- star_count: 777,
- description: 'Wow, such a cool project!')
- @group = create(:group)
- @group.add_user(@group_owner, GroupMember::OWNER)
- @group.add_user(@developer, GroupMember::DEVELOPER)
- @opts = { namespace: @group }
- end
-
- context 'fork project for group' do
- it 'group owner successfully forks project into the group' do
- to_project = fork_project(@project, @group_owner, true, @opts)
- expect(to_project.owner).to eq(@group)
- expect(to_project.namespace).to eq(@group)
- expect(to_project.name).to eq(@project.name)
- expect(to_project.path).to eq(@project.path)
- expect(to_project.description).to eq(@project.description)
- expect(to_project.star_count).to be_zero
- end
- end
-
- context 'fork project for group when user not owner' do
- it 'group developer should fail to fork project into the group' do
- to_project = fork_project(@project, @developer, true, @opts)
- expect(to_project.errors[:namespace]).to eq(['insufficient access rights'])
- end
- end
-
- context 'project already exists in group' do
- it 'should fail due to validation, not transaction failure' do
- existing_project = create(:project, name: @project.name,
- namespace: @group)
- to_project = fork_project(@project, @group_owner, true, @opts)
- expect(existing_project.persisted?).to be_truthy
- expect(to_project.errors[:base]).to eq(['Invalid fork destination'])
- expect(to_project.errors[:name]).to eq(['has already been taken'])
- expect(to_project.errors[:path]).to eq(['has already been taken'])
- end
- end
- end
-
- def fork_project(from_project, user, fork_success = true, params = {})
- context = Projects::ForkService.new(from_project, user, params)
- shell = double('gitlab_shell')
- shell.stub(fork_repository: fork_success)
- context.stub(gitlab_shell: shell)
- context.execute
- end
-end
diff --git a/spec/services/projects/transfer_service_spec.rb b/spec/services/projects/transfer_service_spec.rb
deleted file mode 100644
index 5650626fb18428cc082776a9bbb6169da491ebfb..0000000000000000000000000000000000000000
--- a/spec/services/projects/transfer_service_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe Projects::TransferService do
- let(:user) { create(:user) }
- let(:group) { create(:group) }
- let(:project) { create(:project, namespace: user.namespace) }
-
- context 'namespace -> namespace' do
- before do
- group.add_owner(user)
- @result = transfer_project(project, user, new_namespace_id: group.id)
- end
-
- it { expect(@result).to be_truthy }
- it { expect(project.namespace).to eq(group) }
- end
-
- context 'namespace -> no namespace' do
- before do
- @result = transfer_project(project, user, new_namespace_id: nil)
- end
-
- it { expect(@result).not_to be_nil } # { result.should be_false } passes on nil
- it { expect(@result).to be_falsey }
- it { expect(project.namespace).to eq(user.namespace) }
- end
-
- context 'namespace -> not allowed namespace' do
- before do
- @result = transfer_project(project, user, new_namespace_id: group.id)
- end
-
- it { expect(@result).not_to be_nil } # { result.should be_false } passes on nil
- it { expect(@result).to be_falsey }
- it { expect(project.namespace).to eq(user.namespace) }
- end
-
- def transfer_project(project, user, params)
- Projects::TransferService.new(project, user, params).execute
- end
-end
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb
deleted file mode 100644
index ea5b8813105ca7f1a7b6f4585e2ebb2c8a341ac3..0000000000000000000000000000000000000000
--- a/spec/services/projects/update_service_spec.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require 'spec_helper'
-
-describe Projects::UpdateService do
- describe :update_by_user do
- before do
- @user = create :user
- @admin = create :user, admin: true
- @project = create :project, creator_id: @user.id, namespace: @user.namespace
- @opts = {}
- end
-
- context 'should be private when updated to private' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.private?).to be_truthy }
- end
-
- context 'should be internal when updated to internal' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.internal?).to be_truthy }
- end
-
- context 'should be public when updated to public' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.public?).to be_truthy }
- end
-
- context 'respect configured visibility restrictions setting' do
- before(:each) do
- allow_any_instance_of(ApplicationSetting).to(
- receive(:restricted_visibility_levels).and_return([20])
- )
- end
-
- context 'should be private when updated to private' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.private?).to be_truthy }
- end
-
- context 'should be internal when updated to internal' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.internal?).to be_truthy }
- end
-
- context 'should be private when updated to public' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- update_project(@project, @user, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.private?).to be_truthy }
- end
-
- context 'should be public when updated to public by admin' do
- before do
- @created_private = @project.private?
-
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- update_project(@project, @admin, @opts)
- end
-
- it { expect(@created_private).to be_truthy }
- it { expect(@project.public?).to be_truthy }
- end
- end
- end
-
- def update_project(project, user, opts)
- Projects::UpdateService.new(project, user, opts).execute
- end
-end
diff --git a/spec/services/projects/upload_service_spec.rb b/spec/services/projects/upload_service_spec.rb
deleted file mode 100644
index e5c47015a033c096d406bfe82fb1d6db5418a6c9..0000000000000000000000000000000000000000
--- a/spec/services/projects/upload_service_spec.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-require 'spec_helper'
-
-describe Projects::UploadService do
- describe 'File service' do
- before do
- @user = create :user
- @project = create :project, creator_id: @user.id, namespace: @user.namespace
- end
-
- context 'for valid gif file' do
- before do
- gif = fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif')
- @link_to_file = upload_file(@project.repository, gif)
- end
-
- it { expect(@link_to_file).to have_key('alt') }
- it { expect(@link_to_file).to have_key('url') }
- it { expect(@link_to_file).to have_key('is_image') }
- it { expect(@link_to_file).to have_value('banana_sample') }
- it { expect(@link_to_file['is_image']).to equal(true) }
- it { expect(@link_to_file['url']).to match("/#{@project.path_with_namespace}") }
- it { expect(@link_to_file['url']).to match('banana_sample.gif') }
- end
-
- context 'for valid png file' do
- before do
- png = fixture_file_upload(Rails.root + 'spec/fixtures/dk.png',
- 'image/png')
- @link_to_file = upload_file(@project.repository, png)
- end
-
- it { expect(@link_to_file).to have_key('alt') }
- it { expect(@link_to_file).to have_key('url') }
- it { expect(@link_to_file).to have_value('dk') }
- it { expect(@link_to_file).to have_key('is_image') }
- it { expect(@link_to_file['is_image']).to equal(true) }
- it { expect(@link_to_file['url']).to match("/#{@project.path_with_namespace}") }
- it { expect(@link_to_file['url']).to match('dk.png') }
- end
-
- context 'for valid jpg file' do
- before do
- jpg = fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg')
- @link_to_file = upload_file(@project.repository, jpg)
- end
-
- it { expect(@link_to_file).to have_key('alt') }
- it { expect(@link_to_file).to have_key('url') }
- it { expect(@link_to_file).to have_key('is_image') }
- it { expect(@link_to_file).to have_value('rails_sample') }
- it { expect(@link_to_file['is_image']).to equal(true) }
- it { expect(@link_to_file['url']).to match("/#{@project.path_with_namespace}") }
- it { expect(@link_to_file['url']).to match('rails_sample.jpg') }
- end
-
- context 'for txt file' do
- before do
- txt = fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain')
- @link_to_file = upload_file(@project.repository, txt)
- end
-
- it { expect(@link_to_file).to have_key('alt') }
- it { expect(@link_to_file).to have_key('url') }
- it { expect(@link_to_file).to have_key('is_image') }
- it { expect(@link_to_file).to have_value('doc_sample.txt') }
- it { expect(@link_to_file['is_image']).to equal(false) }
- it { expect(@link_to_file['url']).to match("/#{@project.path_with_namespace}") }
- it { expect(@link_to_file['url']).to match('doc_sample.txt') }
- end
-
- context 'for too large a file' do
- before do
- txt = fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain')
- allow(txt).to receive(:size) { 1000.megabytes.to_i }
- @link_to_file = upload_file(@project.repository, txt)
- end
-
- it { expect(@link_to_file).to eq(nil) }
- end
- end
-
- def upload_file(repository, file)
- Projects::UploadService.new(repository, file).execute
- end
-end
diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb
deleted file mode 100644
index f57bfaea8798f19d0ca7fe145494324b8fd73c3b..0000000000000000000000000000000000000000
--- a/spec/services/search_service_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'spec_helper'
-
-describe 'Search::GlobalService' do
- let(:user) { create(:user) }
- let(:public_user) { create(:user) }
- let(:internal_user) { create(:user) }
-
- let!(:found_project) { create(:empty_project, :private, name: 'searchable_project') }
- let!(:unfound_project) { create(:empty_project, :private, name: 'unfound_project') }
- let!(:internal_project) { create(:empty_project, :internal, name: 'searchable_internal_project') }
- let!(:public_project) { create(:empty_project, :public, name: 'searchable_public_project') }
-
- before do
- found_project.team << [user, :master]
- end
-
- describe '#execute' do
- context 'unauthenticated' do
- it 'should return public projects only' do
- context = Search::GlobalService.new(nil, search: "searchable")
- results = context.execute
- expect(results.objects('projects')).to match_array [public_project]
- end
- end
-
- context 'authenticated' do
- it 'should return public, internal and private projects' do
- context = Search::GlobalService.new(user, search: "searchable")
- results = context.execute
- expect(results.objects('projects')).to match_array [public_project, found_project, internal_project]
- end
-
- it 'should return only public & internal projects' do
- context = Search::GlobalService.new(internal_user, search: "searchable")
- results = context.execute
- expect(results.objects('projects')).to match_array [internal_project, public_project]
- end
-
- it 'namespace name should be searchable' do
- context = Search::GlobalService.new(user, search: found_project.namespace.path)
- results = context.execute
- expect(results.objects('projects')).to match_array [found_project]
- end
- end
- end
-end
diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb
deleted file mode 100644
index 199ac9966087ae5ed2162d856cc194a5e3b96765..0000000000000000000000000000000000000000
--- a/spec/services/system_hooks_service_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'spec_helper'
-
-describe SystemHooksService do
- let (:user) { create :user }
- let (:project) { create :project }
- let (:project_member) { create :project_member }
- let (:key) { create(:key, user: user) }
- let (:group) { create(:group) }
- let (:group_member) { create(:group_member) }
-
- context 'event data' do
- it { expect(event_data(user, :create)).to include(:event_name, :name, :created_at, :email, :user_id) }
- it { expect(event_data(user, :destroy)).to include(:event_name, :name, :created_at, :email, :user_id) }
- it { expect(event_data(project, :create)).to include(:event_name, :name, :created_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
- it { expect(event_data(project, :destroy)).to include(:event_name, :name, :created_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
- it { expect(event_data(project_member, :create)).to include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :access_level, :project_visibility) }
- it { expect(event_data(project_member, :destroy)).to include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :access_level, :project_visibility) }
- it { expect(event_data(key, :create)).to include(:username, :key, :id) }
- it { expect(event_data(key, :destroy)).to include(:username, :key, :id) }
-
- it do
- expect(event_data(group, :create)).to include(
- :event_name, :name, :created_at, :path, :group_id, :owner_name,
- :owner_email
- )
- end
- it do
- expect(event_data(group, :destroy)).to include(
- :event_name, :name, :created_at, :path, :group_id, :owner_name,
- :owner_email
- )
- end
- it do
- expect(event_data(group_member, :create)).to include(
- :event_name, :created_at, :group_name, :group_path, :group_id, :user_id,
- :user_name, :user_email, :group_access
- )
- end
- it do
- expect(event_data(group_member, :destroy)).to include(
- :event_name, :created_at, :group_name, :group_path, :group_id, :user_id,
- :user_name, :user_email, :group_access
- )
- end
- end
-
- context 'event names' do
- it { expect(event_name(user, :create)).to eq "user_create" }
- it { expect(event_name(user, :destroy)).to eq "user_destroy" }
- it { expect(event_name(project, :create)).to eq "project_create" }
- it { expect(event_name(project, :destroy)).to eq "project_destroy" }
- it { expect(event_name(project_member, :create)).to eq "user_add_to_team" }
- it { expect(event_name(project_member, :destroy)).to eq "user_remove_from_team" }
- it { expect(event_name(key, :create)).to eq 'key_create' }
- it { expect(event_name(key, :destroy)).to eq 'key_destroy' }
- it { expect(event_name(group, :create)).to eq 'group_create' }
- it { expect(event_name(group, :destroy)).to eq 'group_destroy' }
- it { expect(event_name(group_member, :create)).to eq 'user_add_to_group' }
- it { expect(event_name(group_member, :destroy)).to eq 'user_remove_from_group' }
- end
-
- def event_data(*args)
- SystemHooksService.new.send :build_event_data, *args
- end
-
- def event_name(*args)
- SystemHooksService.new.send :build_event_name, *args
- end
-end
diff --git a/spec/services/test_hook_service_spec.rb b/spec/services/test_hook_service_spec.rb
deleted file mode 100644
index d2b505f55a250bbc4ab2a9440abde3d8f060a8a2..0000000000000000000000000000000000000000
--- a/spec/services/test_hook_service_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe TestHookService do
- let (:user) { create :user }
- let (:project) { create :project }
- let (:hook) { create :project_hook, project: project }
-
- describe :execute do
- it "should execute successfully" do
- stub_request(:post, hook.url).to_return(status: 200)
- expect(TestHookService.new.execute(hook, user)).to be_truthy
- end
- end
-end
diff --git a/spec/services/update_snippet_service_spec.rb b/spec/services/update_snippet_service_spec.rb
deleted file mode 100644
index 841ef9bfed11e5e037b686e80a5f0ecfbae2e97a..0000000000000000000000000000000000000000
--- a/spec/services/update_snippet_service_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe UpdateSnippetService do
- before do
- @user = create :user
- @admin = create :user, admin: true
- @opts = {
- title: 'Test snippet',
- file_name: 'snippet.rb',
- content: 'puts "hello world"',
- visibility_level: Gitlab::VisibilityLevel::PRIVATE
- }
- end
-
- context 'When public visibility is restricted' do
- before do
- allow_any_instance_of(ApplicationSetting).to(
- receive(:restricted_visibility_levels).and_return(
- [Gitlab::VisibilityLevel::PUBLIC]
- )
- )
-
- @snippet = create_snippet(@project, @user, @opts)
- @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- end
-
- it 'non-admins should not be able to update to public visibility' do
- old_visibility = @snippet.visibility_level
- update_snippet(@project, @user, @snippet, @opts)
- expect(@snippet.errors.messages).to have_key(:visibility_level)
- expect(@snippet.errors.messages[:visibility_level].first).to(
- match('Public visibility has been restricted')
- )
- expect(@snippet.visibility_level).to eq(old_visibility)
- end
-
- it 'admins should be able to update to pubic visibility' do
- old_visibility = @snippet.visibility_level
- update_snippet(@project, @admin, @snippet, @opts)
- expect(@snippet.visibility_level).not_to eq(old_visibility)
- expect(@snippet.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
- end
- end
-
- def create_snippet(project, user, opts)
- CreateSnippetService.new(project, user, opts).execute
- end
-
- def update_snippet(project = nil, user, snippet, opts)
- UpdateSnippetService.new(project, user, snippet, opts).execute
- end
-end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
deleted file mode 100644
index 53ccaa4fd6791833f2adcbaf028d579031bc2a39..0000000000000000000000000000000000000000
--- a/spec/spec_helper.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-if ENV['SIMPLECOV']
- require 'simplecov'
-end
-
-if ENV['COVERALLS']
- require 'coveralls'
- Coveralls.wear_merged!
-end
-
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
-require 'capybara/rails'
-require 'capybara/rspec'
-require 'webmock/rspec'
-require 'email_spec'
-require 'sidekiq/testing/inline'
-require 'capybara/poltergeist'
-
-Capybara.javascript_driver = :poltergeist
-Capybara.default_wait_time = 10
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
-
-WebMock.disable_net_connect!(allow_localhost: true)
-
-RSpec.configure do |config|
- config.use_transactional_fixtures = false
- config.use_instantiated_fixtures = false
- config.mock_with :rspec
-
- config.include LoginHelpers, type: :feature
- config.include LoginHelpers, type: :request
- config.include FactoryGirl::Syntax::Methods
- config.include Devise::TestHelpers, type: :controller
-
- config.include TestEnv
- config.infer_spec_type_from_file_location!
- config.raise_errors_for_deprecations!
-
- config.before(:suite) do
- TestEnv.init
- end
-end
-
-ActiveRecord::Migration.maintain_test_schema!
diff --git a/spec/support/api_helpers.rb b/spec/support/api_helpers.rb
deleted file mode 100644
index ec9a326a1ea0252d8afbb21b3f89312c8038d86b..0000000000000000000000000000000000000000
--- a/spec/support/api_helpers.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-module ApiHelpers
- # Public: Prepend a request path with the path to the API
- #
- # path - Path to append
- # user - User object - If provided, automatically appends private_token query
- # string for authenticated requests
- #
- # Examples
- #
- # >> api('/issues')
- # => "/api/v2/issues"
- #
- # >> api('/issues', User.last)
- # => "/api/v2/issues?private_token=..."
- #
- # >> api('/issues?foo=bar', User.last)
- # => "/api/v2/issues?foo=bar&private_token=..."
- #
- # Returns the relative path to the requested API resource
- def api(path, user = nil)
- "/api/#{API::API.version}#{path}" +
-
- # Normalize query string
- (path.index('?') ? '' : '?') +
-
- # Append private_token if given a User object
- (user.respond_to?(:private_token) ?
- "&private_token=#{user.private_token}" : "")
- end
-
- def json_response
- JSON.parse(response.body)
- end
-end
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
deleted file mode 100644
index cca7652093a6e17bb5013123c36a81d797231ecd..0000000000000000000000000000000000000000
--- a/spec/support/db_cleaner.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# RSpec.configure do |config|
-
-# config.around(:each) do |example|
-# DatabaseCleaner.strategy = :transaction
-# DatabaseCleaner.clean_with(:truncation)
-# DatabaseCleaner.cleaning do
-# example.run
-# end
-# end
-
-# config.around(:each, js: true) do |example|
-# DatabaseCleaner.strategy = :truncation
-# DatabaseCleaner.clean_with(:truncation)
-# DatabaseCleaner.cleaning do
-# example.run
-# end
-# end
-# end
-RSpec.configure do |config|
- config.before(:suite) do
- DatabaseCleaner.clean_with(:truncation)
- end
-
- config.before(:each) do
- DatabaseCleaner.strategy = :transaction
- end
-
- config.before(:each, :js => true) do
- DatabaseCleaner.strategy = :truncation
- end
-
- config.before(:each) do
- DatabaseCleaner.start
- end
-
- config.after(:each) do
- DatabaseCleaner.clean
- end
-
- # rspec-rails 3 will no longer automatically infer an example group's spec type
- # from the file location. You can explicitly opt-in to the feature using this
- # config option.
- # To explicitly tag specs without using automatic inference, set the `:type`
- # metadata manually:
- #
- # describe ThingsController, :type => :controller do
- # # Equivalent to being in spec/controllers
- # end
- config.infer_spec_type_from_file_location!
-end
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
deleted file mode 100644
index 791d2a1fd648967a9455ae391b5ce9b707d6db16..0000000000000000000000000000000000000000
--- a/spec/support/login_helpers.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module LoginHelpers
- # Internal: Create and log in as a user of the specified role
- #
- # role - User role (e.g., :admin, :user)
- def login_as(role)
- @user = create(role)
-
- login_with(@user)
- end
-
- # Internal: Login as the specified user
- #
- # user - User instance to login with
- def login_with(user)
- visit new_user_session_path
- fill_in "user_login", with: user.email
- fill_in "user_password", with: "12345678"
- click_button "Sign in"
- Thread.current[:current_user] = user
- end
-
- # Requires Javascript driver.
- def logout
- find(:css, ".fa.fa-sign-out").click
- end
-end
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
deleted file mode 100644
index 52b11bd6323c717231890d41b9e3add601f14147..0000000000000000000000000000000000000000
--- a/spec/support/matchers.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-RSpec::Matchers.define :be_valid_commit do
- match do |actual|
- actual != nil
- actual.id == ValidCommit::ID
- actual.message == ValidCommit::MESSAGE
- actual.author_name == ValidCommit::AUTHOR_FULL_NAME
- end
-end
-
-RSpec::Matchers.define :be_allowed_for do |user|
- match do |url|
- include UrlAccess
- url_allowed?(user, url)
- end
-end
-
-RSpec::Matchers.define :be_denied_for do |user|
- match do |url|
- include UrlAccess
- url_denied?(user, url)
- end
-end
-
-RSpec::Matchers.define :be_404_for do |user|
- match do |url|
- include UrlAccess
- url_404?(user, url)
- end
-end
-
-RSpec::Matchers.define :include_module do |expected|
- match do
- described_class.included_modules.include?(expected)
- end
-
- failure_message_for_should do
- "expected #{described_class} to include the #{expected} module"
- end
-end
-
-module UrlAccess
- def url_allowed?(user, url)
- emulate_user(user)
- visit url
- (status_code != 404 && current_path != new_user_session_path)
- end
-
- def url_denied?(user, url)
- emulate_user(user)
- visit url
- (status_code == 404 || current_path == new_user_session_path)
- end
-
- def url_404?(user, url)
- emulate_user(user)
- visit url
- status_code == 404
- end
-
- def emulate_user(user)
- user = case user
- when :user then create(:user)
- when :visitor then nil
- when :admin then create(:admin)
- else user
- end
- login_with(user) if user
- end
-end
-
-# Extend shoulda-matchers
-module Shoulda::Matchers::ActiveModel
- class EnsureLengthOfMatcher
- # Shortcut for is_at_least and is_at_most
- def is_within(range)
- is_at_least(range.min) && is_at_most(range.max)
- end
- end
-end
diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb
deleted file mode 100644
index 305592fa5a656fcaa937cea525fee7e4c0fad05d..0000000000000000000000000000000000000000
--- a/spec/support/mentionable_shared_examples.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-# Specifications for behavior common to all Mentionable implementations.
-# Requires a shared context containing:
-# - let(:subject) { "the mentionable implementation" }
-# - let(:backref_text) { "the way that +subject+ should refer to itself in backreferences " }
-# - let(:set_mentionable_text) { lambda { |txt| "block that assigns txt to the subject's mentionable_text" } }
-
-def common_mentionable_setup
- # Avoid name collisions with let(:project) or let(:author) in the surrounding scope.
- let(:mproject) { create :project }
- let(:mauthor) { subject.author }
-
- let(:mentioned_issue) { create :issue, project: mproject }
- let(:other_issue) { create :issue, project: mproject }
- let(:mentioned_mr) { create :merge_request, :simple, source_project: mproject }
- let(:mentioned_commit) { double('commit', sha: '1234567890abcdef').as_null_object }
-
- let(:ext_proj) { create :project, :public }
- let(:ext_issue) { create :issue, project: ext_proj }
- let(:other_ext_issue) { create :issue, project: ext_proj }
- let(:ext_mr) { create :merge_request, :simple, source_project: ext_proj }
- let(:ext_commit) { ext_proj.repository.commit }
-
- # Override to add known commits to the repository stub.
- let(:extra_commits) { [] }
-
- # A string that mentions each of the +mentioned_.*+ objects above. Mentionables should add a self-reference
- # to this string and place it in their +mentionable_text+.
- let(:ref_string) do
- "mentions ##{mentioned_issue.iid} twice ##{mentioned_issue.iid}, " +
- "!#{mentioned_mr.iid}, " +
- "#{ext_proj.path_with_namespace}##{ext_issue.iid}, " +
- "#{ext_proj.path_with_namespace}!#{ext_mr.iid}, " +
- "#{ext_proj.path_with_namespace}@#{ext_commit.short_id}, " +
- "#{mentioned_commit.sha[0..10]} and itself as #{backref_text}"
- end
-
- before do
- # Wire the project's repository to return the mentioned commit, and +nil+ for any
- # unrecognized commits.
- commitmap = { '1234567890a' => mentioned_commit }
- extra_commits.each { |c| commitmap[c.short_id] = c }
- allow(mproject.repository).to receive(:commit) { |sha| commitmap[sha] }
- set_mentionable_text.call(ref_string)
- end
-end
-
-shared_examples 'a mentionable' do
- common_mentionable_setup
-
- it 'generates a descriptive back-reference' do
- expect(subject.gfm_reference).to eq(backref_text)
- end
-
- it "extracts references from its reference property" do
- # De-duplicate and omit itself
- refs = subject.references(mproject)
- expect(refs.size).to eq(6)
- expect(refs).to include(mentioned_issue)
- expect(refs).to include(mentioned_mr)
- expect(refs).to include(mentioned_commit)
- expect(refs).to include(ext_issue)
- expect(refs).to include(ext_mr)
- expect(refs).to include(ext_commit)
- end
-
- it 'creates cross-reference notes' do
- mentioned_objects = [mentioned_issue, mentioned_mr, mentioned_commit,
- ext_issue, ext_mr, ext_commit]
-
- mentioned_objects.each do |referenced|
- expect(Note).to receive(:create_cross_reference_note).with(referenced, subject.local_reference, mauthor, mproject)
- end
-
- subject.create_cross_references!(mproject, mauthor)
- end
-
- it 'detects existing cross-references' do
- Note.create_cross_reference_note(mentioned_issue, subject.local_reference, mauthor, mproject)
-
- expect(subject.has_mentioned?(mentioned_issue)).to be_truthy
- expect(subject.has_mentioned?(mentioned_mr)).to be_falsey
- end
-end
-
-shared_examples 'an editable mentionable' do
- common_mentionable_setup
-
- it_behaves_like 'a mentionable'
-
- it 'creates new cross-reference notes when the mentionable text is edited' do
- new_text = "still mentions ##{mentioned_issue.iid}, " +
- "#{mentioned_commit.sha[0..10]}, " +
- "#{ext_issue.iid}, " +
- "new refs: ##{other_issue.iid}, " +
- "#{ext_proj.path_with_namespace}##{other_ext_issue.iid}"
-
- [mentioned_issue, mentioned_commit, ext_issue].each do |oldref|
- expect(Note).not_to receive(:create_cross_reference_note).with(oldref, subject.local_reference,
- mauthor, mproject)
- end
-
- [other_issue, other_ext_issue].each do |newref|
- expect(Note).to receive(:create_cross_reference_note).with(
- newref,
- subject.local_reference,
- mauthor,
- mproject
- )
- end
-
- subject.save
- set_mentionable_text.call(new_text)
- subject.notice_added_references(mproject, mauthor)
- end
-end
diff --git a/spec/support/repo_helpers.rb b/spec/support/repo_helpers.rb
deleted file mode 100644
index aadf791bf3ff1ee5c245dc11e31dd1ac1d6f8d25..0000000000000000000000000000000000000000
--- a/spec/support/repo_helpers.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-module RepoHelpers
- extend self
-
- # Text file in repo
- #
- # Ex.
- #
- # # Get object
- # blob = RepoHelpers.text_blob
- #
- # blob.path # => 'files/js/commit.js.coffee'
- # blob.data # => 'class Commit...'
- #
- def sample_blob
- OpenStruct.new(
- oid: '5f53439ca4b009096571d3c8bc3d09d30e7431b3',
- path: "files/js/commit.js.coffee",
- data: <
- $('.files .diff-file').each ->
- new CommitFile(this)
-
-@Commit = Commit
-eos
- )
- end
-
- def sample_commit
- OpenStruct.new(
- id: "570e7b2abdd848b95f2f578043fc23bd6f6fd24d",
- parent_id: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9',
- author_full_name: "Dmitriy Zaporozhets",
- author_email: "dmitriy.zaporozhets@gmail.com",
- files_changed_count: 2,
- line_code: '2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14',
- line_code_path: 'files/ruby/popen.rb',
- del_line_code: '2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13',
- message: <
-eos
- )
- end
-
- def another_sample_commit
- OpenStruct.new(
- id: "e56497bb5f03a90a51293fc6d516788730953899",
- parent_id: '4cd80ccab63c82b4bad16faa5193fbd2aa06df40',
- author_full_name: "Sytse Sijbrandij",
- author_email: "sytse@gitlab.com",
- files_changed_count: 1,
- message: <
-eos
- )
- end
-
- def sample_image_commit
- OpenStruct.new(
- id: "2f63565e7aac07bcdadb654e253078b727143ec4",
- author_full_name: "Dmitriy Zaporozhets",
- author_email: "dmitriy.zaporozhets@gmail.com",
- old_blob_id: '33f3729a45c02fc67d00adb1b8bca394b0e761d9',
- new_blob_id: '2f63565e7aac07bcdadb654e253078b727143ec4',
- message: <
-eos
- )
- end
-
- def sample_compare
- changes = [
- {
- line_code: 'a5cc2925ca8258af241be7e5b0381edf30266302_20_20',
- file_path: '.gitignore',
- },
- {
- line_code: '7445606fbf8f3683cd42bdc54b05d7a0bc2dfc44_4_6',
- file_path: '.gitmodules',
- }
- ]
-
- commits = [
- '5937ac0a7beb003549fc5fd26fc247adbce4a52e',
- '570e7b2abdd848b95f2f578043fc23bd6f6fd24d',
- '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9',
- 'd14d6c0abdd253381df51a723d58691b2ee1ab08',
- 'c1acaa58bbcbc3eafe538cb8274ba387047b69f8',
- ].reverse # last commit is recent one
-
- OpenStruct.new(
- source_branch: 'master',
- target_branch: 'feature',
- changes: changes,
- commits: commits
- )
- end
-end
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb
deleted file mode 100644
index 691f84f39d477335d54c845799abc892bf2278e0..0000000000000000000000000000000000000000
--- a/spec/support/select2_helper.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# Select2 ajax programmatic helper
-# It allows you to select value from select2
-#
-# Params
-# value - real value of selected item
-# opts - options containing css selector
-#
-# Usage:
-#
-# select2(2, from: '#user_ids')
-#
-
-module Select2Helper
- def select2(value, options={})
- raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from)
-
- selector = options[:from]
-
- if options[:multiple]
- execute_script("$('#{selector}').select2('val', ['#{value}'], true);")
- else
- execute_script("$('#{selector}').select2('val', '#{value}', true);")
- end
- end
-end
diff --git a/spec/support/taskable_shared_examples.rb b/spec/support/taskable_shared_examples.rb
deleted file mode 100644
index 490f453d4684cb027b0362db842ba5d7b0ff3b76..0000000000000000000000000000000000000000
--- a/spec/support/taskable_shared_examples.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# Specs for task state functionality for issues and merge requests.
-#
-# Requires a context containing:
-# let(:subject) { Issue or MergeRequest }
-shared_examples 'a Taskable' do
- before do
- subject.description = < 'e56497b',
- 'feature' => '0b4bc9a',
- 'feature_conflict' => 'bb5206f',
- 'fix' => '12d65c8',
- 'improve/awesome' => '5937ac0',
- 'markdown' => '0ed8c6c',
- 'master' => '5937ac0'
- }
-
- # Test environment
- #
- # See gitlab.yml.example test section for paths
- #
- def init(opts = {})
- # Disable mailer for spinach tests
- disable_mailer if opts[:mailer] == false
-
- clean_test_path
-
- FileUtils.mkdir_p(repos_path)
-
- # Setup GitLab shell for test instance
- setup_gitlab_shell
-
- # Create repository for FactoryGirl.create(:project)
- setup_factory_repo
- end
-
- def disable_mailer
- NotificationService.any_instance.stub(mailer: double.as_null_object)
- end
-
- def enable_mailer
- allow_any_instance_of(NotificationService).to receive(:mailer).and_call_original
- end
-
- # Clean /tmp/tests
- #
- # Keeps gitlab-shell and gitlab-test
- def clean_test_path
- tmp_test_path = Rails.root.join('tmp', 'tests', '**')
-
- Dir[tmp_test_path].each do |entry|
- unless File.basename(entry) =~ /\Agitlab-(shell|test)\z/
- FileUtils.rm_rf(entry)
- end
- end
- end
-
- def setup_gitlab_shell
- unless File.directory?(Rails.root.join(*%w(tmp tests gitlab-shell)))
- `rake gitlab:shell:install`
- end
- end
-
- def setup_factory_repo
- clone_url = "https://gitlab.com/gitlab-org/#{factory_repo_name}.git"
-
- unless File.directory?(factory_repo_path)
- system(*%W(git clone -q #{clone_url} #{factory_repo_path}))
- end
-
- Dir.chdir(factory_repo_path) do
- BRANCH_SHA.each do |branch, sha|
- # Try to reset without fetching to avoid using the network.
- reset = %W(git update-ref refs/heads/#{branch} #{sha})
- unless system(*reset)
- if system(*%w(git fetch origin))
- unless system(*reset)
- raise 'The fetched test seed '\
- 'does not contain the required revision.'
- end
- else
- raise 'Could not fetch test seed repository.'
- end
- end
- end
- end
-
- # We must copy bare repositories because we will push to them.
- system(git_env, *%W(git clone -q --bare #{factory_repo_path} #{factory_repo_path_bare}))
- end
-
- def copy_repo(project)
- base_repo_path = File.expand_path(factory_repo_path_bare)
- target_repo_path = File.expand_path(repos_path + "/#{project.namespace.path}/#{project.path}.git")
- FileUtils.mkdir_p(target_repo_path)
- FileUtils.cp_r("#{base_repo_path}/.", target_repo_path)
- FileUtils.chmod_R 0755, target_repo_path
- end
-
- def repos_path
- Gitlab.config.gitlab_shell.repos_path
- end
-
- private
-
- def factory_repo_path
- @factory_repo_path ||= Rails.root.join('tmp', 'tests', factory_repo_name)
- end
-
- def factory_repo_path_bare
- "#{factory_repo_path}_bare"
- end
-
- def factory_repo_name
- 'gitlab-test'
- end
-
- # Prevent developer git configurations from being persisted to test
- # repositories
- def git_env
- {'GIT_TEMPLATE_DIR' => ''}
- end
-end
diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb
deleted file mode 100644
index a59f74c21219169a4481281680b36ed4d7b1f1e7..0000000000000000000000000000000000000000
--- a/spec/tasks/gitlab/backup_rake_spec.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-require 'spec_helper'
-require 'rake'
-
-describe 'gitlab:app namespace rake task' do
- before :all do
- Rake.application.rake_require "tasks/gitlab/task_helpers"
- Rake.application.rake_require "tasks/gitlab/backup"
- Rake.application.rake_require "tasks/gitlab/shell"
- # empty task as env is already loaded
- Rake::Task.define_task :environment
- end
-
- def run_rake_task(task_name)
- Rake::Task[task_name].reenable
- Rake.application.invoke_task task_name
- end
-
- describe 'backup_restore' do
- before do
- # avoid writing task output to spec progress
- allow($stdout).to receive :write
- end
-
- context 'gitlab version' do
- before do
- Dir.stub glob: []
- allow(Dir).to receive :chdir
- File.stub exists?: true
- Kernel.stub system: true
- FileUtils.stub cp_r: true
- FileUtils.stub mv: true
- Rake::Task["gitlab:shell:setup"].stub invoke: true
- end
-
- let(:gitlab_version) { Gitlab::VERSION }
-
- it 'should fail on mismatch' do
- YAML.stub load_file: {gitlab_version: "not #{gitlab_version}" }
- expect { run_rake_task('gitlab:backup:restore') }.to(
- raise_error SystemExit
- )
- end
-
- it 'should invoke restoration on mach' do
- YAML.stub load_file: {gitlab_version: gitlab_version}
- expect(Rake::Task["gitlab:backup:db:restore"]).to receive :invoke
- expect(Rake::Task["gitlab:backup:repo:restore"]).to receive :invoke
- expect(Rake::Task["gitlab:shell:setup"]).to receive :invoke
- expect { run_rake_task('gitlab:backup:restore') }.to_not raise_error
- end
- end
-
- end # backup_restore task
-
- describe 'backup_create' do
- def tars_glob
- Dir.glob(File.join(Gitlab.config.backup.path, '*_gitlab_backup.tar'))
- end
-
- before :all do
- # Record the existing backup tars so we don't touch them
- existing_tars = tars_glob
-
- # Redirect STDOUT and run the rake task
- orig_stdout = $stdout
- $stdout = StringIO.new
- run_rake_task('gitlab:backup:create')
- $stdout = orig_stdout
-
- @backup_tar = (tars_glob - existing_tars).first
- end
-
- after :all do
- FileUtils.rm(@backup_tar)
- end
-
- it 'should set correct permissions on the tar file' do
- expect(File.exist?(@backup_tar)).to be_truthy
- expect(File::Stat.new(@backup_tar).mode.to_s(8)).to eq('100600')
- end
-
- it 'should set correct permissions on the tar contents' do
- tar_contents, exit_status = Gitlab::Popen.popen(
- %W{tar -tvf #{@backup_tar} db uploads repositories}
- )
- expect(exit_status).to eq(0)
- expect(tar_contents).to match('db/')
- expect(tar_contents).to match('uploads/')
- expect(tar_contents).to match('repositories/')
- expect(tar_contents).not_to match(/^.{4,9}[rwx].* (db|uploads|repositories)\/$/)
- end
-
- it 'should delete temp directories' do
- temp_dirs = Dir.glob(
- File.join(Gitlab.config.backup.path, '{db,repositories,uploads}')
- )
-
- expect(temp_dirs).to be_empty
- end
- end # backup_create task
-
- describe "Skipping items" do
- def tars_glob
- Dir.glob(File.join(Gitlab.config.backup.path, '*_gitlab_backup.tar'))
- end
-
- before :all do
- @origin_cd = Dir.pwd
-
- Rake::Task["gitlab:backup:db:create"].reenable
- Rake::Task["gitlab:backup:repo:create"].reenable
- Rake::Task["gitlab:backup:uploads:create"].reenable
-
- # Record the existing backup tars so we don't touch them
- existing_tars = tars_glob
-
- # Redirect STDOUT and run the rake task
- orig_stdout = $stdout
- $stdout = StringIO.new
- ENV["SKIP"] = "repositories"
- run_rake_task('gitlab:backup:create')
- $stdout = orig_stdout
-
- @backup_tar = (tars_glob - existing_tars).first
- end
-
- after :all do
- FileUtils.rm(@backup_tar)
- Dir.chdir @origin_cd
- end
-
- it "does not contain skipped item" do
- tar_contents, exit_status = Gitlab::Popen.popen(
- %W{tar -tvf #{@backup_tar} db uploads repositories}
- )
-
- expect(tar_contents).to match('db/')
- expect(tar_contents).to match('uploads/')
- expect(tar_contents).not_to match('repositories/')
- end
-
- it 'does not invoke repositories restore' do
- Rake::Task["gitlab:shell:setup"].stub invoke: true
- allow($stdout).to receive :write
-
- expect(Rake::Task["gitlab:backup:db:restore"]).to receive :invoke
- expect(Rake::Task["gitlab:backup:repo:restore"]).not_to receive :invoke
- expect(Rake::Task["gitlab:shell:setup"]).to receive :invoke
- expect { run_rake_task('gitlab:backup:restore') }.to_not raise_error
- end
- end
-end # gitlab:app namespace
diff --git a/spec/tasks/gitlab/mail_google_schema_whitelisting.rb b/spec/tasks/gitlab/mail_google_schema_whitelisting.rb
deleted file mode 100644
index 22e746870dc701cee6518b165970ff49df06a442..0000000000000000000000000000000000000000
--- a/spec/tasks/gitlab/mail_google_schema_whitelisting.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-require 'rake'
-
-describe 'gitlab:mail_google_schema_whitelisting rake task' do
- before :all do
- Rake.application.rake_require "tasks/gitlab/task_helpers"
- Rake.application.rake_require "tasks/gitlab/mail_google_schema_whitelisting"
- # empty task as env is already loaded
- Rake::Task.define_task :environment
- end
-
- describe 'call' do
- before do
- # avoid writing task output to spec progress
- allow($stdout).to receive :write
- end
-
- let :run_rake_task do
- Rake::Task["gitlab:mail_google_schema_whitelisting"].reenable
- Rake.application.invoke_task "gitlab:mail_google_schema_whitelisting"
- end
-
- it 'should run the task without errors' do
- expect { run_rake_task }.to_not raise_error
- end
- end
-end
diff --git a/spec/workers/fork_registration_worker_spec.rb b/spec/workers/fork_registration_worker_spec.rb
deleted file mode 100644
index cc6f574b29c640977822092cb268ea8845e05cd3..0000000000000000000000000000000000000000
--- a/spec/workers/fork_registration_worker_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-require 'spec_helper'
-
-describe ForkRegistrationWorker do
- context "as a resque worker" do
- it "reponds to #perform" do
- expect(ForkRegistrationWorker.new).to respond_to(:perform)
- end
- end
-end
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
deleted file mode 100644
index df1a2b84a53c644d443e40f1d536e4f45ba31fc2..0000000000000000000000000000000000000000
--- a/spec/workers/post_receive_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-
-describe PostReceive do
- let(:changes) { "123456 789012 refs/heads/tést\n654321 210987 refs/tags/tag" }
- let(:wrongly_encoded_changes) { changes.encode("ISO-8859-1").force_encoding("UTF-8") }
- let(:base64_changes) { Base64.encode64(wrongly_encoded_changes) }
-
- context "as a resque worker" do
- it "reponds to #perform" do
- expect(PostReceive.new).to respond_to(:perform)
- end
- end
-
- context "web hook" do
- let(:project) { create(:project) }
- let(:key) { create(:key, user: project.owner) }
- let(:key_id) { key.shell_id }
-
- it "fetches the correct project" do
- expect(Project).to receive(:find_with_namespace).with(project.path_with_namespace).and_return(project)
- PostReceive.new.perform(pwd(project), key_id, base64_changes)
- end
-
- it "does not run if the author is not in the project" do
- allow(Key).to receive(:find_by).with(hash_including(id: anything())) { nil }
-
- expect(project).not_to receive(:execute_hooks)
-
- expect(PostReceive.new.perform(pwd(project), key_id, base64_changes)).to be_falsey
- end
-
- it "asks the project to trigger all hooks" do
- Project.stub(find_with_namespace: project)
- expect(project).to receive(:execute_hooks).twice
- expect(project).to receive(:execute_services).twice
- expect(project).to receive(:update_merge_requests)
-
- PostReceive.new.perform(pwd(project), key_id, base64_changes)
- end
- end
-
- def pwd(project)
- File.join(Gitlab.config.gitlab_shell.repos_path, project.path_with_namespace)
- end
-end
diff --git a/spec/workers/repository_archive_worker_spec.rb b/spec/workers/repository_archive_worker_spec.rb
deleted file mode 100644
index c2362058cfdeee8f36f0e1ccc39501eafd1ef18e..0000000000000000000000000000000000000000
--- a/spec/workers/repository_archive_worker_spec.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'spec_helper'
-
-describe RepositoryArchiveWorker do
- let(:project) { create(:project) }
- subject { RepositoryArchiveWorker.new }
-
- before do
- allow(Project).to receive(:find).and_return(project)
- end
-
- describe "#perform" do
- it "cleans old archives" do
- expect(project.repository).to receive(:clean_old_archives)
-
- subject.perform(project.id, "master", "zip")
- end
-
- context "when the repository doesn't have an archive file path" do
- before do
- allow(project.repository).to receive(:archive_file_path).and_return(nil)
- end
-
- it "doesn't archive the repo" do
- expect(project.repository).not_to receive(:archive_repo)
-
- subject.perform(project.id, "master", "zip")
- end
- end
-
- context "when the repository has an archive file path" do
- let(:file_path) { "/archive.zip" }
- let(:pid_file_path) { "/archive.zip.pid" }
-
- before do
- allow(project.repository).to receive(:archive_file_path).and_return(file_path)
- allow(project.repository).to receive(:archive_pid_file_path).and_return(pid_file_path)
- end
-
- context "when the archive file already exists" do
- before do
- allow(File).to receive(:exist?).with(file_path).and_return(true)
- end
-
- it "doesn't archive the repo" do
- expect(project.repository).not_to receive(:archive_repo)
-
- subject.perform(project.id, "master", "zip")
- end
- end
-
- context "when the archive file doesn't exist yet" do
- before do
- allow(File).to receive(:exist?).with(file_path).and_return(false)
- allow(File).to receive(:exist?).with(pid_file_path).and_return(true)
- end
-
- context "when the archive pid file doesn't exist yet" do
- before do
- allow(File).to receive(:exist?).with(pid_file_path).and_return(false)
- end
-
- it "archives the repo" do
- expect(project.repository).to receive(:archive_repo)
-
- subject.perform(project.id, "master", "zip")
- end
- end
-
- context "when the archive pid file already exists" do
- it "doesn't archive the repo" do
- expect(project.repository).not_to receive(:archive_repo)
-
- subject.perform(project.id, "master", "zip")
- end
- end
- end
- end
- end
-end
-
diff --git a/tmp/.gitkeep b/tmp/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/tmp/pids/.gitkeep b/tmp/pids/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/tmp/sockets/.gitkeep b/tmp/sockets/.gitkeep
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/vendor/assets/javascripts/chart-lib.min.js b/vendor/assets/javascripts/chart-lib.min.js
deleted file mode 100644
index 3a0a2c87345f54eac4a8da8a9e1a81868c645ec7..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/chart-lib.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * Chart.js
- * http://chartjs.org/
- * Version: 1.0.2
- *
- * Copyright 2015 Nick Downie
- * Released under the MIT license
- * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
- */
-(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),st?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),tthis.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;ip&&(p=t.x+s,n=i),t.x-sp&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<% for (var i=0; i- <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
<%}%>
'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<% for (var i=0; i<%if(segments[i].label){%><%=segments[i].label%><%}%> <%}%>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i<%if(datasets[i].label){%><%=datasets[i].label%><%}%> <%}%>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&ithis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<% for (var i=0; i- <%if(segments[i].label){%><%=segments[i].label%><%}%>
<%}%>
'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i<%if(datasets[i].label){%><%=datasets[i].label%><%}%> <%}%>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);
\ No newline at end of file
diff --git a/vendor/assets/javascripts/g.bar-min.js b/vendor/assets/javascripts/g.bar-min.js
deleted file mode 100644
index 7620dabda74366adba1c781d313a4bd26bdcc6c9..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/g.bar-min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * g.Raphael 0.5 - Charting library, based on Raphaël
- *
- * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com)
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
- * From: https://github.com/jhurt/g.raphael/blob/master/g.bar.js
- */
-(function(){function c(c,d,e,f,g,h,i,j){var k,l={round:"round",sharp:"sharp",soft:"soft",square:"square"};if(g&&!f||!g&&!e)return i?"":j.path();switch(h=l[h]||"square",f=Math.round(f),e=Math.round(e),c=Math.round(c),d=Math.round(d),h){case"round":if(g)m=~~(e/2),m>f?(m=f,k=["M",c-~~(e/2),d,"l",0,0,"a",~~(e/2),m,0,0,1,e,0,"l",0,0,"z"]):k=["M",c-m,d,"l",0,m-f,"a",m,m,0,1,1,e,0,"l",0,f-m,"z"];else{var m=~~(f/2);m>e?(m=e,k=["M",c+.5,d+.5-~~(f/2),"l",0,0,"a",m,~~(f/2),0,0,1,0,f,"l",0,0,"z"]):k=["M",c+.5,d+.5-m,"l",e-m,0,"a",m,m,0,1,1,0,f,"l",m-e,0,"z"]}break;case"sharp":if(g)n=~~(e/2),k=["M",c+n,d,"l",-e,0,0,-b(f-n,0),n,-a(n,f),n,a(n,f),n,"z"];else{var n=~~(f/2);k=["M",c,d+n,"l",0,-f,b(e-n,0),0,a(n,e),n,-a(n,e),n+(f>2*n),"z"]}break;case"square":k=g?["M",c+~~(e/2),d,"l",1-e,0,0,-f,e-1,0,"z"]:["M",c,d+~~(f/2),"l",0,-f,e,0,0,f,"z"];break;case"soft":g?(m=a(Math.round(e/5),f),k=["M",c-~~(e/2),d,"l",0,m-f,"a",m,m,0,0,1,m,-m,"l",e-2*m,0,"a",m,m,0,0,1,m,m,"l",0,f-m,"z"]):(m=a(e,Math.round(f/5)),k=["M",c+.5,d+.5-~~(f/2),"l",e-m,0,"a",m,m,0,0,1,m,m,"l",0,f-2*m,"a",m,m,0,0,1,-m,m,"l",m-e,0,"z"])}return i?k.join(","):j.path(k)}function d(a,b,d,e,f,g,h){h=h||{};var i=this,j=h.type||"square",k=parseFloat(h.gutter||"20%"),l=a.set(),m=a.set(),n=a.set(),o=a.set(),p=Math.max.apply(Math,g),q=[],r=0,s=h.colors||i.colors,t=g.length;if(Raphael.is(g[0],"array")){p=[],r=t,t=0;for(var u=g.length;u--;)m.push(a.set()),p.push(Math.max.apply(Math,g[u])),t=Math.max(t,g[u].length);if(h.stacked)for(var u=t;u--;){for(var v=0,w=g.length;w--;)v+=+g[w][u]||0;q.push(v)}for(var u=g.length;u--;)if(t>g[u].length)for(var w=t;w--;)g[u].push(0);p=Math.max.apply(Math,h.stacked?q:p)}p=h.to||p;var x=100*(e/(t*(100+k)+k)),y=x*k/100,z=null==h.vgutter?20:h.vgutter,A=[],B=b+y,C=(f-2*z)/p;h.stretch||(y=Math.round(y),x=Math.floor(x)),!h.stacked&&(x/=r||1);for(var u=0;t>u;u++){A=[];for(var w=0;(r||1)>w;w++){var D=Math.round((r?g[w][u]:g[u])*C),E=d+f-z-D,F=c(Math.round(B+x/2),E+D,x,D,!0,j,null,a).attr({stroke:"none",fill:s[r?w:u]});r?m[w].push(F):m.push(F),F.y=E,F.x=Math.round(B+x/2),F.w=x,F.h=D,F.value=r?g[w][u]:g[u],h.stacked?A.push(F):B+=x}if(h.stacked){var G;o.push(G=a.rect(A[0].x-A[0].w/2,d,x,f).attr(i.shim)),G.bars=a.set();for(var H=0,I=A.length;I--;)A[I].toFront();for(var I=0,J=A.length;J>I;I++){var K,F=A[I],D=(H+F.value)*C,L=c(F.x,d+f-z-.5*!!H,x,D,!0,j,1,a);G.bars.push(F),H&&F.attr({path:L}),F.h=D,F.y=d+f-z-.5*!!H-D,n.push(K=a.rect(F.x-F.w/2,F.y,x,F.value*C).attr(i.shim)),K.bar=F,K.value=F.value,H+=F.value}B+=x}B+=y}if(o.toFront(),B=b+y,!h.stacked)for(var u=0;t>u;u++){for(var w=0;(r||1)>w;w++){var K;n.push(K=a.rect(Math.round(B),d+z,x,f-z).attr(i.shim)),K.bar=r?m[w][u]:m[u],K.value=K.bar.value,B+=x}B+=y}return l.label=function(b,c){b=b||[],this.labels=a.set();var e,j=-1/0;if(h.stacked){for(var k=0;t>k;k++)for(var l=0,o=0;(r||1)>o;o++)if(l+=r?g[o][k]:g[k],o==r-1){var q=i.labelise(b[k],l,p);e=a.text(m[o][k].x,d+f-z/2,q).attr(i.txtattr).attr({fill:h.legendcolor||"#000","text-anchor":"start"}).insertBefore(n[k*(r||1)+o]);var s=e.getBBox();j>s.x-7?e.remove():(this.labels.push(e),j=s.x+s.width)}}else for(var k=0;t>k;k++)for(var o=0;(r||1)>o;o++){var q=i.labelise(r?b[o]&&b[o][k]:b[k],r?g[o][k]:g[k],p);e=a.text(m[o][k].x-x/2,c?d+f-z/2:m[o][k].y-10,q).attr(i.txtattr).attr({fill:h.legendcolor||"#000","text-anchor":"start"}).insertBefore(n[k*(r||1)+o]);var s=e.getBBox();e.translate((x-s.width)/2,1),j>s.x-7?e.remove():(this.labels.push(e),j=s.x+s.width)}return this},l.hover=function(a,b){return o.hide(),n.show(),n.mouseover(a).mouseout(b),this},l.hoverColumn=function(a,b){return n.hide(),o.show(),b=b||function(){},o.mouseover(a).mouseout(b),this},l.click=function(a){return o.hide(),n.show(),n.click(a),this},l.each=function(a){if(!Raphael.is(a,"function"))return this;for(var b=n.length;b--;)a.call(n[b]);return this},l.eachColumn=function(a){if(!Raphael.is(a,"function"))return this;for(var b=o.length;b--;)a.call(o[b]);return this},l.clickColumn=function(a){return n.hide(),o.show(),o.click(a),this},l.push(m,n,o),l.bars=m,l.covers=n,l}function e(a,b,d,e,f,g,h){h=h||{};var i=this,j=h.type||"square",k=parseFloat(h.gutter||"20%"),l=a.set(),m=a.set(),n=a.set(),o=a.set(),p=Math.max.apply(Math,g),q=[],r=0,s=h.colors||i.colors,t=g.length;if(Raphael.is(g[0],"array")){p=[],r=t,t=0;for(var u=g.length;u--;)m.push(a.set()),p.push(Math.max.apply(Math,g[u])),t=Math.max(t,g[u].length);if(h.stacked)for(var u=t;u--;){for(var v=0,w=g.length;w--;)v+=+g[w][u]||0;q.push(v)}for(var u=g.length;u--;)if(t>g[u].length)for(var w=t;w--;)g[u].push(0);p=Math.max.apply(Math,h.stacked?q:p)}p=h.to||p;var x=Math.floor(100*(f/(t*(100+k)+k))),y=Math.floor(x*k/100),z=[],A=d+y,B=(e-1)/p;!h.stacked&&(x/=r||1);for(var u=0;t>u;u++){z=[];for(var w=0;(r||1)>w;w++){var C=r?g[w][u]:g[u],D=c(b,A+x/2,Math.round(C*B),x-1,!1,j,null,a).attr({stroke:"none",fill:s[r?w:u]});r?m[w].push(D):m.push(D),D.x=b+Math.round(C*B),D.y=A+x/2,D.w=Math.round(C*B),D.h=x,D.value=+C,h.stacked?z.push(D):A+=x}if(h.stacked){var E=a.rect(b,z[0].y-z[0].h/2,e,x).attr(i.shim);o.push(E),E.bars=a.set();for(var F=0,G=z.length;G--;)z[G].toFront();for(var G=0,H=z.length;H>G;G++){var I,D=z[G],C=Math.round((F+D.value)*B),J=c(b,D.y,C,x-1,!1,j,1,a);E.bars.push(D),F&&D.attr({path:J}),D.w=C,D.x=b+C,n.push(I=a.rect(b+F*B,D.y-D.h/2,D.value*B,x).attr(i.shim)),I.bar=D,F+=D.value}A+=x}A+=y}if(o.toFront(),A=d+y,!h.stacked)for(var u=0;t>u;u++){for(var w=0;(r||1)>w;w++){var I=a.rect(b,A,e,x).attr(i.shim);n.push(I),I.bar=r?m[w][u]:m[u],I.value=I.bar.value,A+=x}A+=y}return l.label=function(c,d){c=c||[],this.labels=a.set();for(var e=0;t>e;e++)for(var f=0;r>f;f++){var o,j=i.labelise(r?c[f]&&c[f][e]:c[e],r?g[f][e]:g[e],p),k=d?m[f][e].x-x/2+3:b+5;this.labels.push(o=a.text(k,m[f][e].y,j).attr(i.txtattr).attr({fill:h.legendcolor||"#000","text-anchor":"start"}).insertBefore(n[0])),b+5>o.getBBox().x?o.attr({x:b+5,"text-anchor":"start"}):m[f][e].label=o}return this},l.hover=function(a,b){return o.hide(),n.show(),b=b||function(){},n.mouseover(a).mouseout(b),this},l.hoverColumn=function(a,b){return n.hide(),o.show(),b=b||function(){},o.mouseover(a).mouseout(b),this},l.each=function(a){if(!Raphael.is(a,"function"))return this;for(var b=n.length;b--;)a.call(n[b]);return this},l.eachColumn=function(a){if(!Raphael.is(a,"function"))return this;for(var b=o.length;b--;)a.call(o[b]);return this},l.click=function(a){return o.hide(),n.show(),n.click(a),this},l.clickColumn=function(a){return n.hide(),o.show(),o.click(a),this},l.push(m,n,o),l.bars=m,l.covers=n,l}var a=Math.min,b=Math.max,f=function(){};f.prototype=Raphael.g,e.prototype=d.prototype=new f,Raphael.fn.hbarchart=function(a,b,c,d,f,g){return new e(this,a,b,c,d,f,g)},Raphael.fn.barchart=function(a,b,c,e,f,g){return new d(this,a,b,c,e,f,g)}})();
\ No newline at end of file
diff --git a/vendor/assets/javascripts/g.raphael-min.js b/vendor/assets/javascripts/g.raphael-min.js
deleted file mode 100644
index f8b381c623bc553a4cefcf930b8bf08078ad4847..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/g.raphael-min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * g.Raphael 0.51 - Charting library, based on Raphaël
- *
- * Copyright (c) 2009-2012 Dmitry Baranovskiy (http://g.raphaeljs.com)
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
- */
-Raphael.el.popup=function(a,b,c,d){var f,g,h,i,j,e=this.paper||this[0].paper;if(e){switch(this.type){case"text":case"circle":case"ellipse":h=!0;break;default:h=!1}a=null==a?"up":a,b=b||5,f=this.getBBox(),c="number"==typeof c?c:h?f.x+f.width/2:f.x,d="number"==typeof d?d:h?f.y+f.height/2:f.y,i=Math.max(f.width/2-b,0),j=Math.max(f.height/2-b,0),this.translate(c-f.x-(h?f.width/2:0),d-f.y-(h?f.height/2:0)),f=this.getBBox();var k={up:["M",c,d,"l",-b,-b,-i,0,"a",b,b,0,0,1,-b,-b,"l",0,-f.height,"a",b,b,0,0,1,b,-b,"l",2*b+2*i,0,"a",b,b,0,0,1,b,b,"l",0,f.height,"a",b,b,0,0,1,-b,b,"l",-i,0,"z"].join(","),down:["M",c,d,"l",b,b,i,0,"a",b,b,0,0,1,b,b,"l",0,f.height,"a",b,b,0,0,1,-b,b,"l",-(2*b+2*i),0,"a",b,b,0,0,1,-b,-b,"l",0,-f.height,"a",b,b,0,0,1,b,-b,"l",i,0,"z"].join(","),left:["M",c,d,"l",-b,b,0,j,"a",b,b,0,0,1,-b,b,"l",-f.width,0,"a",b,b,0,0,1,-b,-b,"l",0,-(2*b+2*j),"a",b,b,0,0,1,b,-b,"l",f.width,0,"a",b,b,0,0,1,b,b,"l",0,j,"z"].join(","),right:["M",c,d,"l",b,-b,0,-j,"a",b,b,0,0,1,b,-b,"l",f.width,0,"a",b,b,0,0,1,b,b,"l",0,2*b+2*j,"a",b,b,0,0,1,-b,b,"l",-f.width,0,"a",b,b,0,0,1,-b,-b,"l",0,-j,"z"].join(",")};return g={up:{x:-!h*(f.width/2),y:2*-b-(h?f.height/2:f.height)},down:{x:-!h*(f.width/2),y:2*b+(h?f.height/2:f.height)},left:{x:2*-b-(h?f.width/2:f.width),y:-!h*(f.height/2)},right:{x:2*b+(h?f.width/2:f.width),y:-!h*(f.height/2)}}[a],this.translate(g.x,g.y),e.path(k[a]).attr({fill:"#000",stroke:"none"}).insertBefore(this.node?this:this[0])}},Raphael.el.tag=function(a,b,c,d){var e=3,f=this.paper||this[0].paper;if(f){var i,j,k,g=f.path().attr({fill:"#000",stroke:"#000"}),h=this.getBBox();switch(this.type){case"text":case"circle":case"ellipse":k=!0;break;default:k=!1}return a=a||0,c="number"==typeof c?c:k?h.x+h.width/2:h.x,d="number"==typeof d?d:k?h.y+h.height/2:h.y,b=null==b?5:b,j=.5522*b,h.height>=2*b?g.attr({path:["M",c,d+b,"a",b,b,0,1,1,0,2*-b,b,b,0,1,1,0,2*b,"m",0,2*-b-e,"a",b+e,b+e,0,1,0,0,2*(b+e),"L",c+b+e,d+h.height/2+e,"l",h.width+2*e,0,0,-h.height-2*e,-h.width-2*e,0,"L",c,d-b-e].join(",")}):(i=Math.sqrt(Math.pow(b+e,2)-Math.pow(h.height/2+e,2)),g.attr({path:["M",c,d+b,"c",-j,0,-b,j-b,-b,-b,0,-j,b-j,-b,b,-b,j,0,b,b-j,b,b,0,j,j-b,b,-b,b,"M",c+i,d-h.height/2-e,"a",b+e,b+e,0,1,0,0,h.height+2*e,"l",b+e-i+h.width+2*e,0,0,-h.height-2*e,"L",c+i,d-h.height/2-e].join(",")})),a=360-a,g.rotate(a,c,d),this.attrs?(this.attr(this.attrs.x?"x":"cx",c+b+e+(k?h.width/2:"text"==this.type?h.width:0)).attr("y",k?d:d-h.height/2),this.rotate(a,c,d),a>90&&270>a&&this.attr(this.attrs.x?"x":"cx",c-b-e-(k?h.width/2:h.width)).rotate(180,c,d)):a>90&&270>a?(this.translate(c-h.x-h.width-b-e,d-h.y-h.height/2),this.rotate(a-180,h.x+h.width+b+e,h.y+h.height/2)):(this.translate(c-h.x+b+e,d-h.y-h.height/2),this.rotate(a,h.x-b-e,h.y+h.height/2)),g.insertBefore(this.node?this:this[0])}},Raphael.el.drop=function(a,b,c){var f,g,h,i,j,d=this.getBBox(),e=this.paper||this[0].paper;if(e){switch(this.type){case"text":case"circle":case"ellipse":f=!0;break;default:f=!1}return a=a||0,b="number"==typeof b?b:f?d.x+d.width/2:d.x,c="number"==typeof c?c:f?d.y+d.height/2:d.y,g=Math.max(d.width,d.height)+Math.min(d.width,d.height),h=e.path(["M",b,c,"l",g,0,"A",.4*g,.4*g,0,1,0,b+.7*g,c-.7*g,"z"]).attr({fill:"#000",stroke:"none"}).rotate(22.5-a,b,c),a=(a+90)*Math.PI/180,i=b+g*Math.sin(a)-(f?0:d.width/2),j=c+g*Math.cos(a)-(f?0:d.height/2),this.attrs?this.attr(this.attrs.x?"x":"cx",i).attr(this.attrs.y?"y":"cy",j):this.translate(i-d.x,j-d.y),h.insertBefore(this.node?this:this[0])}},Raphael.el.flag=function(a,b,c){var d=3,e=this.paper||this[0].paper;if(e){var i,f=e.path().attr({fill:"#000",stroke:"#000"}),g=this.getBBox(),h=g.height/2;switch(this.type){case"text":case"circle":case"ellipse":i=!0;break;default:i=!1}return a=a||0,b="number"==typeof b?b:i?g.x+g.width/2:g.x,c="number"==typeof c?c:i?g.y+g.height/2:g.y,f.attr({path:["M",b,c,"l",h+d,-h-d,g.width+2*d,0,0,g.height+2*d,-g.width-2*d,0,"z"].join(",")}),a=360-a,f.rotate(a,b,c),this.attrs?(this.attr(this.attrs.x?"x":"cx",b+h+d+(i?g.width/2:"text"==this.type?g.width:0)).attr("y",i?c:c-g.height/2),this.rotate(a,b,c),a>90&&270>a&&this.attr(this.attrs.x?"x":"cx",b-h-d-(i?g.width/2:g.width)).rotate(180,b,c)):a>90&&270>a?(this.translate(b-g.x-g.width-h-d,c-g.y-g.height/2),this.rotate(a-180,g.x+g.width+h+d,g.y+g.height/2)):(this.translate(b-g.x+h+d,c-g.y-g.height/2),this.rotate(a,g.x-h-d,g.y+g.height/2)),f.insertBefore(this.node?this:this[0])}},Raphael.el.label=function(){var a=this.getBBox(),b=this.paper||this[0].paper,c=Math.min(20,a.width+10,a.height+10)/2;if(b)return b.rect(a.x-c/2,a.y-c/2,a.width+c,a.height+c,c).attr({stroke:"none",fill:"#000"}).insertBefore(this.node?this:this[0])},Raphael.el.blob=function(a,b,c){var g,h,i,d=this.getBBox(),e=Math.PI/180,f=this.paper||this[0].paper;if(f){switch(this.type){case"text":case"circle":case"ellipse":h=!0;break;default:h=!1}g=f.path().attr({fill:"#000",stroke:"none"}),a=(+a+1?a:45)+90,i=Math.min(d.height,d.width),b="number"==typeof b?b:h?d.x+d.width/2:d.x,c="number"==typeof c?c:h?d.y+d.height/2:d.y;var j=Math.max(d.width+i,25*i/12),k=Math.max(d.height+i,25*i/12),l=b+i*Math.sin((a-22.5)*e),m=c+i*Math.cos((a-22.5)*e),n=b+i*Math.sin((a+22.5)*e),o=c+i*Math.cos((a+22.5)*e),p=(n-l)/2,q=(o-m)/2,r=j/2,s=k/2,t=-Math.sqrt(Math.abs(r*r*s*s-r*r*q*q-s*s*p*p)/(r*r*q*q+s*s*p*p)),u=t*r*q/s+(n+l)/2,v=t*-s*p/r+(o+m)/2;return g.attr({x:u,y:v,path:["M",b,c,"L",n,o,"A",r,s,0,1,1,l,m,"z"].join(",")}),this.translate(u-d.x-d.width/2,v-d.y-d.height/2),g.insertBefore(this.node?this:this[0])}},Raphael.fn.label=function(a,b,c){var d=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),d.push(c.label(),c)},Raphael.fn.popup=function(a,b,c,d,e){var f=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),f.push(c.popup(d,e),c)},Raphael.fn.tag=function(a,b,c,d,e){var f=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),f.push(c.tag(d,e),c)},Raphael.fn.flag=function(a,b,c,d){var e=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),e.push(c.flag(d),c)},Raphael.fn.drop=function(a,b,c,d){var e=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),e.push(c.drop(d),c)},Raphael.fn.blob=function(a,b,c,d){var e=this.set();return c=this.text(a,b,c).attr(Raphael.g.txtattr),e.push(c.blob(d),c)},Raphael.el.lighter=function(a){a=a||2;var b=[this.attrs.fill,this.attrs.stroke];return this.fs=this.fs||[b[0],b[1]],b[0]=Raphael.rgb2hsb(Raphael.getRGB(b[0]).hex),b[1]=Raphael.rgb2hsb(Raphael.getRGB(b[1]).hex),b[0].b=Math.min(b[0].b*a,1),b[0].s=b[0].s/a,b[1].b=Math.min(b[1].b*a,1),b[1].s=b[1].s/a,this.attr({fill:"hsb("+[b[0].h,b[0].s,b[0].b]+")",stroke:"hsb("+[b[1].h,b[1].s,b[1].b]+")"}),this},Raphael.el.darker=function(a){a=a||2;var b=[this.attrs.fill,this.attrs.stroke];return this.fs=this.fs||[b[0],b[1]],b[0]=Raphael.rgb2hsb(Raphael.getRGB(b[0]).hex),b[1]=Raphael.rgb2hsb(Raphael.getRGB(b[1]).hex),b[0].s=Math.min(b[0].s*a,1),b[0].b=b[0].b/a,b[1].s=Math.min(b[1].s*a,1),b[1].b=b[1].b/a,this.attr({fill:"hsb("+[b[0].h,b[0].s,b[0].b]+")",stroke:"hsb("+[b[1].h,b[1].s,b[1].b]+")"}),this},Raphael.el.resetBrightness=function(){return this.fs&&(this.attr({fill:this.fs[0],stroke:this.fs[1]}),delete this.fs),this},function(){var a=["lighter","darker","resetBrightness"],b=["popup","tag","flag","label","drop","blob"];for(var c in b)(function(a){Raphael.st[a]=function(){return Raphael.el[a].apply(this,arguments)}})(b[c]);for(var c in a)(function(a){Raphael.st[a]=function(){for(var b=0;this.length>b;b++)this[b][a].apply(this[b],arguments);return this}})(a[c])}(),Raphael.g={shim:{stroke:"none",fill:"#000","fill-opacity":0},txtattr:{font:"12px Arial, sans-serif",fill:"#fff"},colors:function(){for(var a=[.6,.2,.05,.1333,.75,0],b=[],c=0;10>c;c++)a.length>c?b.push("hsb("+a[c]+",.75, .75)"):b.push("hsb("+a[c-a.length]+", 1, .5)");return b}(),snapEnds:function(a,b,c){function f(a){return.25>Math.abs(a-.5)?~~a+.5:Math.round(a)}var d=a,e=b;if(d==e)return{from:d,to:e,power:0};var g=(e-d)/c,h=~~g,i=h,j=0;if(h){for(;i;)j--,i=~~(g*Math.pow(10,j))/Math.pow(10,j);j++}else{if(0!=g&&isFinite(g))for(;!h;)j=j||1,h=~~(g*Math.pow(10,j))/Math.pow(10,j),j++;else j=1;j&&j--}return e=f(b*Math.pow(10,j))/Math.pow(10,j),b>e&&(e=f((b+.5)*Math.pow(10,j))/Math.pow(10,j)),d=f((a-(j>0?0:.5))*Math.pow(10,j))/Math.pow(10,j),{from:d,to:e,power:j}},axis:function(a,b,c,d,e,f,g,h,i,j,k){j=null==j?2:j,i=i||"t",f=f||10,k=arguments[arguments.length-1];var t,l="|"==i||" "==i?["M",a+.5,b,"l",0,.001]:1==g||3==g?["M",a+.5,b,"l",0,-c]:["M",a,b+.5,"l",c,0],m=this.snapEnds(d,e,f),n=m.from,o=m.to,p=m.power,q=0,r={font:"11px 'Fontin Sans', Fontin-Sans, sans-serif"},s=k.set();t=(o-n)/f;var u=n,v=p>0?p:0;if(z=c/f,1==+g||3==+g){for(var w=b,x=(g-1?1:-1)*(j+3+!!(g-1));w>=b-c;)"-"!=i&&" "!=i&&(l=l.concat(["M",a-("+"==i||"|"==i?j:2*!(g-1)*j),w+.5,"l",2*j+1,0])),s.push(k.text(a+x,w,h&&h[q++]||(Math.round(u)==u?u:+u.toFixed(v))).attr(r).attr({"text-anchor":g-1?"start":"end"})),u+=t,w-=z;Math.round(w+z-(b-c))&&("-"!=i&&" "!=i&&(l=l.concat(["M",a-("+"==i||"|"==i?j:2*!(g-1)*j),b-c+.5,"l",2*j+1,0])),s.push(k.text(a+x,b-c,h&&h[q]||(Math.round(u)==u?u:+u.toFixed(v))).attr(r).attr({"text-anchor":g-1?"start":"end"})))}else{u=n,v=(p>0)*p,x=(g?-1:1)*(j+9+!g);for(var y=a,z=c/f,A=0,B=0;a+c>=y;){"-"!=i&&" "!=i&&(l=l.concat(["M",y+.5,b-("+"==i?j:2*!!g*j),"l",0,2*j+1])),s.push(A=k.text(y,b+x,h&&h[q++]||(Math.round(u)==u?u:+u.toFixed(v))).attr(r));var C=A.getBBox();B>=C.x-5?s.pop(s.length-1).remove():B=C.x+C.width,u+=t,y+=z}Math.round(y-z-a-c)&&("-"!=i&&" "!=i&&(l=l.concat(["M",a+c+.5,b-("+"==i?j:2*!!g*j),"l",0,2*j+1])),s.push(k.text(a+c,b+x,h&&h[q]||(Math.round(u)==u?u:+u.toFixed(v))).attr(r)))}var D=k.path(l);return D.text=s,D.all=k.set([D,s]),D.remove=function(){this.text.remove(),this.constructor.prototype.remove.call(this)},D},labelise:function(a,b,c){return a?(a+"").replace(/(##+(?:\.#+)?)|(%%+(?:\.%+)?)/g,function(a,d,e){return d?(+b).toFixed(d.replace(/^#+\.?/g,"").length):e?(100*b/c).toFixed(e.replace(/^%+\.?/g,"").length)+"%":void 0}):(+b).toFixed(0)}};
\ No newline at end of file
diff --git a/vendor/assets/javascripts/jquery.blockUI.js b/vendor/assets/javascripts/jquery.blockUI.js
deleted file mode 100644
index c8702d79b654f81ef1ee5039a824dd7f1021e14b..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.blockUI.js
+++ /dev/null
@@ -1,590 +0,0 @@
-/*!
- * jQuery blockUI plugin
- * Version 2.60.0-2013.04.05
- * @requires jQuery v1.7 or later
- *
- * Examples at: http://malsup.com/jquery/block/
- * Copyright (c) 2007-2013 M. Alsup
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Thanks to Amir-Hossein Sobhi for some excellent contributions!
- */
-
-;(function() {
-/*jshint eqeqeq:false curly:false latedef:false */
-"use strict";
-
- function setup($) {
- $.fn._fadeIn = $.fn.fadeIn;
-
- var noOp = $.noop || function() {};
-
- // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
- // retarded userAgent strings on Vista)
- var msie = /MSIE/.test(navigator.userAgent);
- var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
- var mode = document.documentMode || 0;
- var setExpr = $.isFunction( document.createElement('div').style.setExpression );
-
- // global $ methods for blocking/unblocking the entire page
- $.blockUI = function(opts) { install(window, opts); };
- $.unblockUI = function(opts) { remove(window, opts); };
-
- // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
- $.growlUI = function(title, message, timeout, onClose) {
- var $m = $('');
- if (title) $m.append(''+title+'
');
- if (message) $m.append(''+message+'
');
- if (timeout === undefined) timeout = 3000;
- $.blockUI({
- message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
- timeout: timeout, showOverlay: false,
- onUnblock: onClose,
- css: $.blockUI.defaults.growlCSS
- });
- };
-
- // plugin method for blocking element content
- $.fn.block = function(opts) {
- if ( this[0] === window ) {
- $.blockUI( opts );
- return this;
- }
- var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
- this.each(function() {
- var $el = $(this);
- if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
- return;
- $el.unblock({ fadeOut: 0 });
- });
-
- return this.each(function() {
- if ($.css(this,'position') == 'static') {
- this.style.position = 'relative';
- $(this).data('blockUI.static', true);
- }
- this.style.zoom = 1; // force 'hasLayout' in ie
- install(this, opts);
- });
- };
-
- // plugin method for unblocking element content
- $.fn.unblock = function(opts) {
- if ( this[0] === window ) {
- $.unblockUI( opts );
- return this;
- }
- return this.each(function() {
- remove(this, opts);
- });
- };
-
- $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost!
-
- // override these in your code to change the default behavior and style
- $.blockUI.defaults = {
- // message displayed when blocking (use null for no message)
- message: 'Please wait...
',
-
- title: null, // title string; only used when theme == true
- draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
-
- theme: false, // set to true to use with jQuery UI themes
-
- // styles for the message when blocking; if you wish to disable
- // these and use an external stylesheet then do this in your code:
- // $.blockUI.defaults.css = {};
- css: {
- padding: 0,
- margin: 0,
- width: '30%',
- top: '40%',
- left: '35%',
- textAlign: 'center',
- color: '#000',
- border: '3px solid #aaa',
- backgroundColor:'#fff',
- cursor: 'wait'
- },
-
- // minimal style set used when themes are used
- themedCSS: {
- width: '30%',
- top: '40%',
- left: '35%'
- },
-
- // styles for the overlay
- overlayCSS: {
- backgroundColor: '#000',
- opacity: 0.6,
- cursor: 'wait'
- },
-
- // style to replace wait cursor before unblocking to correct issue
- // of lingering wait cursor
- cursorReset: 'default',
-
- // styles applied when using $.growlUI
- growlCSS: {
- width: '350px',
- top: '10px',
- left: '',
- right: '10px',
- border: 'none',
- padding: '5px',
- opacity: 0.6,
- cursor: 'default',
- color: '#fff',
- backgroundColor: '#000',
- '-webkit-border-radius':'10px',
- '-moz-border-radius': '10px',
- 'border-radius': '10px'
- },
-
- // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
- // (hat tip to Jorge H. N. de Vasconcelos)
- /*jshint scripturl:true */
- iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
-
- // force usage of iframe in non-IE browsers (handy for blocking applets)
- forceIframe: false,
-
- // z-index for the blocking overlay
- baseZ: 1000,
-
- // set these to true to have the message automatically centered
- centerX: true, // <-- only effects element blocking (page block controlled via css above)
- centerY: true,
-
- // allow body element to be stetched in ie6; this makes blocking look better
- // on "short" pages. disable if you wish to prevent changes to the body height
- allowBodyStretch: true,
-
- // enable if you want key and mouse events to be disabled for content that is blocked
- bindEvents: true,
-
- // be default blockUI will supress tab navigation from leaving blocking content
- // (if bindEvents is true)
- constrainTabKey: true,
-
- // fadeIn time in millis; set to 0 to disable fadeIn on block
- fadeIn: 200,
-
- // fadeOut time in millis; set to 0 to disable fadeOut on unblock
- fadeOut: 400,
-
- // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
- timeout: 0,
-
- // disable if you don't want to show the overlay
- showOverlay: true,
-
- // if true, focus will be placed in the first available input field when
- // page blocking
- focusInput: true,
-
- // elements that can receive focus
- focusableElements: ':input:enabled:visible',
-
- // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
- // no longer needed in 2012
- // applyPlatformOpacityRules: true,
-
- // callback method invoked when fadeIn has completed and blocking message is visible
- onBlock: null,
-
- // callback method invoked when unblocking has completed; the callback is
- // passed the element that has been unblocked (which is the window object for page
- // blocks) and the options that were passed to the unblock call:
- // onUnblock(element, options)
- onUnblock: null,
-
- // callback method invoked when the overlay area is clicked.
- // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
- onOverlayClick: null,
-
- // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
- quirksmodeOffsetHack: 4,
-
- // class name of the message block
- blockMsgClass: 'blockMsg',
-
- // if it is already blocked, then ignore it (don't unblock and reblock)
- ignoreIfBlocked: false
- };
-
- // private data and functions follow...
-
- var pageBlock = null;
- var pageBlockEls = [];
-
- function install(el, opts) {
- var css, themedCSS;
- var full = (el == window);
- var msg = (opts && opts.message !== undefined ? opts.message : undefined);
- opts = $.extend({}, $.blockUI.defaults, opts || {});
-
- if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
- return;
-
- opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
- css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
- if (opts.onOverlayClick)
- opts.overlayCSS.cursor = 'pointer';
-
- themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
- msg = msg === undefined ? opts.message : msg;
-
- // remove the current block (if there is one)
- if (full && pageBlock)
- remove(window, {fadeOut:0});
-
- // if an existing element is being used as the blocking content then we capture
- // its current place in the DOM (and current display style) so we can restore
- // it when we unblock
- if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
- var node = msg.jquery ? msg[0] : msg;
- var data = {};
- $(el).data('blockUI.history', data);
- data.el = node;
- data.parent = node.parentNode;
- data.display = node.style.display;
- data.position = node.style.position;
- if (data.parent)
- data.parent.removeChild(node);
- }
-
- $(el).data('blockUI.onUnblock', opts.onUnblock);
- var z = opts.baseZ;
-
- // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
- // layer1 is the iframe layer which is used to supress bleed through of underlying content
- // layer2 is the overlay layer which has opacity and a wait cursor (by default)
- // layer3 is the message content that is displayed while blocking
- var lyr1, lyr2, lyr3, s;
- if (msie || opts.forceIframe)
- lyr1 = $('');
- else
- lyr1 = $('');
-
- if (opts.theme)
- lyr2 = $('');
- else
- lyr2 = $('');
-
- if (opts.theme && full) {
- s = '';
- }
- else if (opts.theme) {
- s = '';
- }
- else if (full) {
- s = '';
- }
- else {
- s = '';
- }
- lyr3 = $(s);
-
- // if we have a message, style it
- if (msg) {
- if (opts.theme) {
- lyr3.css(themedCSS);
- lyr3.addClass('ui-widget-content');
- }
- else
- lyr3.css(css);
- }
-
- // style the overlay
- if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
- lyr2.css(opts.overlayCSS);
- lyr2.css('position', full ? 'fixed' : 'absolute');
-
- // make iframe layer transparent in IE
- if (msie || opts.forceIframe)
- lyr1.css('opacity',0.0);
-
- //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
- var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
- $.each(layers, function() {
- this.appendTo($par);
- });
-
- if (opts.theme && opts.draggable && $.fn.draggable) {
- lyr3.draggable({
- handle: '.ui-dialog-titlebar',
- cancel: 'li'
- });
- }
-
- // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
- var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
- if (ie6 || expr) {
- // give body 100% height
- if (full && opts.allowBodyStretch && $.support.boxModel)
- $('html,body').css('height','100%');
-
- // fix ie6 issue when blocked element has a border width
- if ((ie6 || !$.support.boxModel) && !full) {
- var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
- var fixT = t ? '(0 - '+t+')' : 0;
- var fixL = l ? '(0 - '+l+')' : 0;
- }
-
- // simulate fixed position
- $.each(layers, function(i,o) {
- var s = o[0].style;
- s.position = 'absolute';
- if (i < 2) {
- if (full)
- s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
- else
- s.setExpression('height','this.parentNode.offsetHeight + "px"');
- if (full)
- s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
- else
- s.setExpression('width','this.parentNode.offsetWidth + "px"');
- if (fixL) s.setExpression('left', fixL);
- if (fixT) s.setExpression('top', fixT);
- }
- else if (opts.centerY) {
- if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
- s.marginTop = 0;
- }
- else if (!opts.centerY && full) {
- var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
- var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
- s.setExpression('top',expression);
- }
- });
- }
-
- // show the message
- if (msg) {
- if (opts.theme)
- lyr3.find('.ui-widget-content').append(msg);
- else
- lyr3.append(msg);
- if (msg.jquery || msg.nodeType)
- $(msg).show();
- }
-
- if ((msie || opts.forceIframe) && opts.showOverlay)
- lyr1.show(); // opacity is zero
- if (opts.fadeIn) {
- var cb = opts.onBlock ? opts.onBlock : noOp;
- var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
- var cb2 = msg ? cb : noOp;
- if (opts.showOverlay)
- lyr2._fadeIn(opts.fadeIn, cb1);
- if (msg)
- lyr3._fadeIn(opts.fadeIn, cb2);
- }
- else {
- if (opts.showOverlay)
- lyr2.show();
- if (msg)
- lyr3.show();
- if (opts.onBlock)
- opts.onBlock();
- }
-
- // bind key and mouse events
- bind(1, el, opts);
-
- if (full) {
- pageBlock = lyr3[0];
- pageBlockEls = $(opts.focusableElements,pageBlock);
- if (opts.focusInput)
- setTimeout(focus, 20);
- }
- else
- center(lyr3[0], opts.centerX, opts.centerY);
-
- if (opts.timeout) {
- // auto-unblock
- var to = setTimeout(function() {
- if (full)
- $.unblockUI(opts);
- else
- $(el).unblock(opts);
- }, opts.timeout);
- $(el).data('blockUI.timeout', to);
- }
- }
-
- // remove the block
- function remove(el, opts) {
- var count;
- var full = (el == window);
- var $el = $(el);
- var data = $el.data('blockUI.history');
- var to = $el.data('blockUI.timeout');
- if (to) {
- clearTimeout(to);
- $el.removeData('blockUI.timeout');
- }
- opts = $.extend({}, $.blockUI.defaults, opts || {});
- bind(0, el, opts); // unbind events
-
- if (opts.onUnblock === null) {
- opts.onUnblock = $el.data('blockUI.onUnblock');
- $el.removeData('blockUI.onUnblock');
- }
-
- var els;
- if (full) // crazy selector to handle odd field errors in ie6/7
- els = $('body').children().filter('.blockUI').add('body > .blockUI');
- else
- els = $el.find('>.blockUI');
-
- // fix cursor issue
- if ( opts.cursorReset ) {
- if ( els.length > 1 )
- els[1].style.cursor = opts.cursorReset;
- if ( els.length > 2 )
- els[2].style.cursor = opts.cursorReset;
- }
-
- if (full)
- pageBlock = pageBlockEls = null;
-
- if (opts.fadeOut) {
- count = els.length;
- els.fadeOut(opts.fadeOut, function() {
- if ( --count === 0)
- reset(els,data,opts,el);
- });
- }
- else
- reset(els, data, opts, el);
- }
-
- // move blocking element back into the DOM where it started
- function reset(els,data,opts,el) {
- var $el = $(el);
- els.each(function(i,o) {
- // remove via DOM calls so we don't lose event handlers
- if (this.parentNode)
- this.parentNode.removeChild(this);
- });
-
- if (data && data.el) {
- data.el.style.display = data.display;
- data.el.style.position = data.position;
- if (data.parent)
- data.parent.appendChild(data.el);
- $el.removeData('blockUI.history');
- }
-
- if ($el.data('blockUI.static')) {
- $el.css('position', 'static'); // #22
- }
-
- if (typeof opts.onUnblock == 'function')
- opts.onUnblock(el,opts);
-
- // fix issue in Safari 6 where block artifacts remain until reflow
- var body = $(document.body), w = body.width(), cssW = body[0].style.width;
- body.width(w-1).width(w);
- body[0].style.width = cssW;
- }
-
- // bind/unbind the handler
- function bind(b, el, opts) {
- var full = el == window, $el = $(el);
-
- // don't bother unbinding if there is nothing to unbind
- if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
- return;
-
- $el.data('blockUI.isBlocked', b);
-
- // don't bind events when overlay is not in use or if bindEvents is false
- if (!full || !opts.bindEvents || (b && !opts.showOverlay))
- return;
-
- // bind anchors and inputs for mouse and key events
- var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
- if (b)
- $(document).bind(events, opts, handler);
- else
- $(document).unbind(events, handler);
-
- // former impl...
- // var $e = $('a,:input');
- // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
- }
-
- // event handler to suppress keyboard/mouse events when blocking
- function handler(e) {
- // allow tab navigation (conditionally)
- if (e.keyCode && e.keyCode == 9) {
- if (pageBlock && e.data.constrainTabKey) {
- var els = pageBlockEls;
- var fwd = !e.shiftKey && e.target === els[els.length-1];
- var back = e.shiftKey && e.target === els[0];
- if (fwd || back) {
- setTimeout(function(){focus(back);},10);
- return false;
- }
- }
- }
- var opts = e.data;
- var target = $(e.target);
- if (target.hasClass('blockOverlay') && opts.onOverlayClick)
- opts.onOverlayClick();
-
- // allow events within the message content
- if (target.parents('div.' + opts.blockMsgClass).length > 0)
- return true;
-
- // allow events for content that is not being blocked
- return target.parents().children().filter('div.blockUI').length === 0;
- }
-
- function focus(back) {
- if (!pageBlockEls)
- return;
- var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
- if (e)
- e.focus();
- }
-
- function center(el, x, y) {
- var p = el.parentNode, s = el.style;
- var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
- var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
- if (x) s.left = l > 0 ? (l+'px') : '0';
- if (y) s.top = t > 0 ? (t+'px') : '0';
- }
-
- function sz(el, p) {
- return parseInt($.css(el,p),10)||0;
- }
-
- }
-
-
- /*global define:true */
- if (typeof define === 'function' && define.amd && define.amd.jQuery) {
- define(['jquery'], setup);
- } else {
- setup(jQuery);
- }
-
-})();
diff --git a/vendor/assets/javascripts/jquery.cookie.js b/vendor/assets/javascripts/jquery.cookie.js
deleted file mode 100644
index 6a3e394b403d5084b70b8ed7ccdc0d566f2fcbdb..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.cookie.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * jQuery Cookie plugin
- *
- * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- */
-jQuery.cookie = function (key, value, options) {
-
- // key and at least value given, set cookie...
- if (arguments.length > 1 && String(value) !== "[object Object]") {
- options = jQuery.extend({}, options);
-
- if (value === null || value === undefined) {
- options.expires = -1;
- }
-
- if (typeof options.expires === 'number') {
- var days = options.expires, t = options.expires = new Date();
- t.setDate(t.getDate() + days);
- }
-
- value = String(value);
-
- return (document.cookie = [
- encodeURIComponent(key), '=',
- options.raw ? value : encodeURIComponent(value),
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
- options.path ? '; path=' + options.path : '',
- options.domain ? '; domain=' + options.domain : '',
- options.secure ? '; secure' : ''
- ].join(''));
- }
-
- // key and possibly options given, get cookie...
- options = value || {};
- var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
- return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
-};
diff --git a/vendor/assets/javascripts/jquery.endless-scroll.js b/vendor/assets/javascripts/jquery.endless-scroll.js
deleted file mode 100644
index 38db6b0510127ebd9d6dc02e19a75fff0a6af2d8..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.endless-scroll.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Endless Scroll plugin for jQuery
- *
- * v1.4.8
- *
- * Copyright (c) 2008 Fred Wu
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- */
-
-/**
- * Usage:
- *
- * // using default options
- * $(document).endlessScroll();
- *
- * // using some custom options
- * $(document).endlessScroll({
- * fireOnce: false,
- * fireDelay: false,
- * loader: "",
- * callback: function(){
- * alert("test");
- * }
- * });
- *
- * Configuration options:
- *
- * bottomPixels integer the number of pixels from the bottom of the page that triggers the event
- * fireOnce boolean only fire once until the execution of the current event is completed
- * fireDelay integer delay the subsequent firing, in milliseconds, 0 or false to disable delay
- * loader string the HTML to be displayed during loading
- * data string|function plain HTML data, can be either a string or a function that returns a string,
- * when passed as a function it accepts one argument: fire sequence (the number
- * of times the event triggered during the current page session)
- * insertAfter string jQuery selector syntax: where to put the loader as well as the plain HTML data
- * callback function callback function, accepts one argument: fire sequence (the number of times
- * the event triggered during the current page session)
- * resetCounter function resets the fire sequence counter if the function returns true, this function
- * could also perform hook actions since it is applied at the start of the event
- * ceaseFire function stops the event (no more endless scrolling) if the function returns true
- *
- * Usage tips:
- *
- * The plugin is more useful when used with the callback function, which can then make AJAX calls to retrieve content.
- * The fire sequence argument (for the callback function) is useful for 'pagination'-like features.
- */
-
-(function($){
-
- $.fn.endlessScroll = function(options) {
-
- var defaults = {
- bottomPixels : 50,
- fireOnce : true,
- fireDelay : 150,
- loader : "
Loading...
",
- data : "",
- insertAfter : "div:last",
- resetCounter : function() { return false; },
- callback : function() { return true; },
- ceaseFire : function() { return false; }
- };
-
- var options = $.extend({}, defaults, options),
- firing = true,
- fired = false,
- fireSequence = 0,
- is_scrollable;
-
- if (options.ceaseFire.apply(this) === true)
- firing = false;
-
- if (firing === true) {
- $(this).scroll(function() {
- if (options.ceaseFire.apply(this) === true) {
- firing = false;
- return; // Scroll will still get called, but nothing will happen
- }
-
- if (this == document || this == window) {
- is_scrollable = $(document).height() - $(window).height() <= $(window).scrollTop() + options.bottomPixels;
- } else {
- // calculates the actual height of the scrolling container
- var inner_wrap = $(".endless_scroll_inner_wrap", this);
- if (inner_wrap.length == 0)
- inner_wrap = $(this).wrapInner("").find(".endless_scroll_inner_wrap");
- is_scrollable = inner_wrap.length > 0 &&
- (inner_wrap.height() - $(this).height() <= $(this).scrollTop() + options.bottomPixels);
- }
-
- if (is_scrollable && (options.fireOnce == false || (options.fireOnce == true && fired != true))) {
- if (options.resetCounter.apply(this) === true) fireSequence = 0;
-
- fired = true;
- fireSequence++;
-
- $(options.insertAfter).after("" + options.loader + "");
-
- data = typeof options.data == 'function' ? options.data.apply(this, [fireSequence]) : options.data;
-
- if (data !== false) {
- $(options.insertAfter).after("" + data + "");
- $("#endless_scroll_data").hide().fadeIn(250, function() {$(this).removeAttr("id");});
-
- options.callback.apply(this, [fireSequence]);
-
- if (options.fireDelay !== false || options.fireDelay !== 0) {
- $("body").after("");
- // slight delay for preventing event firing twice
- $("#endless_scroll_marker").fadeTo(options.fireDelay, 1, function() {
- $(this).remove();
- fired = false;
- });
- }
- else
- fired = false;
- }
-
- $("#endless_scroll_loader").remove();
- }
- });
- }
- };
-
-})(jQuery);
\ No newline at end of file
diff --git a/vendor/assets/javascripts/jquery.highlight.js b/vendor/assets/javascripts/jquery.highlight.js
deleted file mode 100644
index 7a67cf99844921c9d93757a4da93ce7d84fe4664..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.highlight.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-
-highlight v3
-
-Highlights arbitrary terms.
-
-
-
-MIT license.
-
-Johann Burkard
-
-
-
-*/
-
-jQuery.fn.highlight = function(pat) {
- function innerHighlight(node, pat) {
- var skip = 0;
- if (node.nodeType == 3) {
- var pos = node.data.toUpperCase().indexOf(pat);
- if (pos >= 0) {
- var spannode = document.createElement('span');
- spannode.className = 'highlight_word';
- var middlebit = node.splitText(pos);
- var endbit = middlebit.splitText(pat.length);
- var middleclone = middlebit.cloneNode(true);
- spannode.appendChild(middleclone);
- middlebit.parentNode.replaceChild(spannode, middlebit);
- skip = 1;
- }
- }
- else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
- for (var i = 0; i < node.childNodes.length; ++i) {
- i += innerHighlight(node.childNodes[i], pat);
- }
- }
- return skip;
- }
- return this.each(function() {
- innerHighlight(this, pat.toUpperCase());
- });
-};
-
-jQuery.fn.removeHighlight = function() {
- return this.find("span.highlight").each(function() {
- this.parentNode.firstChild.nodeName;
- with (this.parentNode) {
- replaceChild(this.firstChild, this);
- normalize();
- }
- }).end();
-};
diff --git a/vendor/assets/javascripts/jquery.history.js b/vendor/assets/javascripts/jquery.history.js
deleted file mode 100644
index 8d4edcd210e2c3b6883084e3afe7c4d7af3d4a6a..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.history.js
+++ /dev/null
@@ -1 +0,0 @@
-window.JSON||(window.JSON={}),function(){function f(a){return a<10?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c")&&c[0]);return a>4?a:!1}();return a},m.isInternetExplorer=function(){var a=m.isInternetExplorer.cached=typeof m.isInternetExplorer.cached!="undefined"?m.isInternetExplorer.cached:Boolean(m.getInternetExplorerMajorVersion());return a},m.emulated={pushState:!Boolean(a.history&&a.history.pushState&&a.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(e.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(e.userAgent)),hashChange:Boolean(!("onhashchange"in a||"onhashchange"in d)||m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8)},m.enabled=!m.emulated.pushState,m.bugs={setHash:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),safariPoll:Boolean(!m.emulated.pushState&&e.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(e.userAgent)),ieDoubleCheck:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(m.isInternetExplorer()&&m.getInternetExplorerMajorVersion()<7)},m.isEmptyObject=function(a){for(var b in a)return!1;return!0},m.cloneObject=function(a){var b,c;return a?(b=k.stringify(a),c=k.parse(b)):c={},c},m.getRootUrl=function(){var a=d.location.protocol+"//"+(d.location.hostname||d.location.host);if(d.location.port||!1)a+=":"+d.location.port;return a+="/",a},m.getBaseHref=function(){var a=d.getElementsByTagName("base"),b=null,c="";return a.length===1&&(b=a[0],c=b.href.replace(/[^\/]+$/,"")),c=c.replace(/\/+$/,""),c&&(c+="/"),c},m.getBaseUrl=function(){var a=m.getBaseHref()||m.getBasePageUrl()||m.getRootUrl();return a},m.getPageUrl=function(){var a=m.getState(!1,!1),b=(a||{}).url||d.location.href,c;return c=b.replace(/\/+$/,"").replace(/[^\/]+$/,function(a,b,c){return/\./.test(a)?a:a+"/"}),c},m.getBasePageUrl=function(){var a=d.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(a,b,c){return/[^\/]$/.test(a)?"":a}).replace(/\/+$/,"")+"/";return a},m.getFullUrl=function(a,b){var c=a,d=a.substring(0,1);return b=typeof b=="undefined"?!0:b,/[a-z]+\:\/\//.test(a)||(d==="/"?c=m.getRootUrl()+a.replace(/^\/+/,""):d==="#"?c=m.getPageUrl().replace(/#.*/,"")+a:d==="?"?c=m.getPageUrl().replace(/[\?#].*/,"")+a:b?c=m.getBaseUrl()+a.replace(/^(\.\/)+/,""):c=m.getBasePageUrl()+a.replace(/^(\.\/)+/,"")),c.replace(/\#$/,"")},m.getShortUrl=function(a){var b=a,c=m.getBaseUrl(),d=m.getRootUrl();return m.emulated.pushState&&(b=b.replace(c,"")),b=b.replace(d,"/"),m.isTraditionalAnchor(b)&&(b="./"+b),b=b.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),b},m.store={},m.idToState=m.idToState||{},m.stateToId=m.stateToId||{},m.urlToId=m.urlToId||{},m.storedStates=m.storedStates||[],m.savedStates=m.savedStates||[],m.normalizeStore=function(){m.store.idToState=m.store.idToState||{},m.store.urlToId=m.store.urlToId||{},m.store.stateToId=m.store.stateToId||{}},m.getState=function(a,b){typeof a=="undefined"&&(a=!0),typeof b=="undefined"&&(b=!0);var c=m.getLastSavedState();return!c&&b&&(c=m.createStateObject()),a&&(c=m.cloneObject(c),c.url=c.cleanUrl||c.url),c},m.getIdByState=function(a){var b=m.extractId(a.url),c;if(!b){c=m.getStateString(a);if(typeof m.stateToId[c]!="undefined")b=m.stateToId[c];else if(typeof m.store.stateToId[c]!="undefined")b=m.store.stateToId[c];else{for(;;){b=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof m.idToState[b]=="undefined"&&typeof m.store.idToState[b]=="undefined")break}m.stateToId[c]=b,m.idToState[b]=a}}return b},m.normalizeState=function(a){var b,c;if(!a||typeof a!="object")a={};if(typeof a.normalized!="undefined")return a;if(!a.data||typeof a.data!="object")a.data={};b={},b.normalized=!0,b.title=a.title||"",b.url=m.getFullUrl(m.unescapeString(a.url||d.location.href)),b.hash=m.getShortUrl(b.url),b.data=m.cloneObject(a.data),b.id=m.getIdByState(b),b.cleanUrl=b.url.replace(/\??\&_suid.*/,""),b.url=b.cleanUrl,c=!m.isEmptyObject(b.data);if(b.title||c)b.hash=m.getShortUrl(b.url).replace(/\??\&_suid.*/,""),/\?/.test(b.hash)||(b.hash+="?"),b.hash+="&_suid="+b.id;return b.hashedUrl=m.getFullUrl(b.hash),(m.emulated.pushState||m.bugs.safariPoll)&&m.hasUrlDuplicate(b)&&(b.url=b.hashedUrl),b},m.createStateObject=function(a,b,c){var d={data:a,title:b,url:c};return d=m.normalizeState(d),d},m.getStateById=function(a){a=String(a);var c=m.idToState[a]||m.store.idToState[a]||b;return c},m.getStateString=function(a){var b,c,d;return b=m.normalizeState(a),c={data:b.data,title:a.title,url:a.url},d=k.stringify(c),d},m.getStateId=function(a){var b,c;return b=m.normalizeState(a),c=b.id,c},m.getHashByState=function(a){var b,c;return b=m.normalizeState(a),c=b.hash,c},m.extractId=function(a){var b,c,d;return c=/(.*)\&_suid=([0-9]+)$/.exec(a),d=c?c[1]||a:a,b=c?String(c[2]||""):"",b||!1},m.isTraditionalAnchor=function(a){var b=!/[\/\?\.]/.test(a);return b},m.extractState=function(a,b){var c=null,d,e;return b=b||!1,d=m.extractId(a),d&&(c=m.getStateById(d)),c||(e=m.getFullUrl(a),d=m.getIdByUrl(e)||!1,d&&(c=m.getStateById(d)),!c&&b&&!m.isTraditionalAnchor(a)&&(c=m.createStateObject(null,null,e))),c},m.getIdByUrl=function(a){var c=m.urlToId[a]||m.store.urlToId[a]||b;return c},m.getLastSavedState=function(){return m.savedStates[m.savedStates.length-1]||b},m.getLastStoredState=function(){return m.storedStates[m.storedStates.length-1]||b},m.hasUrlDuplicate=function(a){var b=!1,c;return c=m.extractState(a.url),b=c&&c.id!==a.id,b},m.storeState=function(a){return m.urlToId[a.url]=a.id,m.storedStates.push(m.cloneObject(a)),a},m.isLastSavedState=function(a){var b=!1,c,d,e;return m.savedStates.length&&(c=a.id,d=m.getLastSavedState(),e=d.id,b=c===e),b},m.saveState=function(a){return m.isLastSavedState(a)?!1:(m.savedStates.push(m.cloneObject(a)),!0)},m.getStateByIndex=function(a){var b=null;return typeof a=="undefined"?b=m.savedStates[m.savedStates.length-1]:a<0?b=m.savedStates[m.savedStates.length+a]:b=m.savedStates[a],b},m.getHash=function(){var a=m.unescapeHash(d.location.hash);return a},m.unescapeString=function(b){var c=b,d;for(;;){d=a.unescape(c);if(d===c)break;c=d}return c},m.unescapeHash=function(a){var b=m.normalizeHash(a);return b=m.unescapeString(b),b},m.normalizeHash=function(a){var b=a.replace(/[^#]*#/,"").replace(/#.*/,"");return b},m.setHash=function(a,b){var c,e,f;return b!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.setHash,args:arguments,queue:b}),!1):(c=m.escapeHash(a),m.busy(!0),e=m.extractState(a,!0),e&&!m.emulated.pushState?m.pushState(e.data,e.title,e.url,!1):d.location.hash!==c&&(m.bugs.setHash?(f=m.getPageUrl(),m.pushState(null,null,f+"#"+c,!1)):d.location.hash=c),m)},m.escapeHash=function(b){var c=m.normalizeHash(b);return c=a.escape(c),m.bugs.hashEscape||(c=c.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),c},m.getHashByUrl=function(a){var b=String(a).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return b=m.unescapeHash(b),b},m.setTitle=function(a){var b=a.title,c;b||(c=m.getStateByIndex(0),c&&c.url===a.url&&(b=c.title||m.options.initialTitle));try{d.getElementsByTagName("title")[0].innerHTML=b.replace("<","<").replace(">",">").replace(" & "," & ")}catch(e){}return d.title=b,m},m.queues=[],m.busy=function(a){typeof a!="undefined"?m.busy.flag=a:typeof m.busy.flag=="undefined"&&(m.busy.flag=!1);if(!m.busy.flag){h(m.busy.timeout);var b=function(){var a,c,d;if(m.busy.flag)return;for(a=m.queues.length-1;a>=0;--a){c=m.queues[a];if(c.length===0)continue;d=c.shift(),m.fireQueueItem(d),m.busy.timeout=g(b,m.options.busyDelay)}};m.busy.timeout=g(b,m.options.busyDelay)}return m.busy.flag},m.busy.flag=!1,m.fireQueueItem=function(a){return a.callback.apply(a.scope||m,a.args||[])},m.pushQueue=function(a){return m.queues[a.queue||0]=m.queues[a.queue||0]||[],m.queues[a.queue||0].push(a),m},m.queue=function(a,b){return typeof a=="function"&&(a={callback:a}),typeof b!="undefined"&&(a.queue=b),m.busy()?m.pushQueue(a):m.fireQueueItem(a),m},m.clearQueue=function(){return m.busy.flag=!1,m.queues=[],m},m.stateChanged=!1,m.doubleChecker=!1,m.doubleCheckComplete=function(){return m.stateChanged=!0,m.doubleCheckClear(),m},m.doubleCheckClear=function(){return m.doubleChecker&&(h(m.doubleChecker),m.doubleChecker=!1),m},m.doubleCheck=function(a){return m.stateChanged=!1,m.doubleCheckClear(),m.bugs.ieDoubleCheck&&(m.doubleChecker=g(function(){return m.doubleCheckClear(),m.stateChanged||a(),!0},m.options.doubleCheckInterval)),m},m.safariStatePoll=function(){var b=m.extractState(d.location.href),c;if(!m.isLastSavedState(b))c=b;else return;return c||(c=m.createStateObject()),m.Adapter.trigger(a,"popstate"),m},m.back=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.back,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.back(!1)}),n.go(-1),!0)},m.forward=function(a){return a!==!1&&m.busy()?(m.pushQueue({scope:m,callback:m.forward,args:arguments,queue:a}),!1):(m.busy(!0),m.doubleCheck(function(){m.forward(!1)}),n.go(1),!0)},m.go=function(a,b){var c;if(a>0)for(c=1;c<=a;++c)m.forward(b);else{if(!(a<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(c=-1;c>=a;--c)m.back(b)}return m};if(m.emulated.pushState){var o=function(){};m.pushState=m.pushState||o,m.replaceState=m.replaceState||o}else m.onPopState=function(b,c){var e=!1,f=!1,g,h;return m.doubleCheckComplete(),g=m.getHash(),g?(h=m.extractState(g||d.location.href,!0),h?m.replaceState(h.data,h.title,h.url,!1):(m.Adapter.trigger(a,"anchorchange"),m.busy(!1)),m.expectedStateId=!1,!1):(e=m.Adapter.extractEventData("state",b,c)||!1,e?f=m.getStateById(e):m.expectedStateId?f=m.getStateById(m.expectedStateId):f=m.extractState(d.location.href),f||(f=m.createStateObject(null,null,d.location.href)),m.expectedStateId=!1,m.isLastSavedState(f)?(m.busy(!1),!1):(m.storeState(f),m.saveState(f),m.setTitle(f),m.Adapter.trigger(a,"statechange"),m.busy(!1),!0))},m.Adapter.bind(a,"popstate",m.onPopState),m.pushState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.pushState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.pushState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0},m.replaceState=function(b,c,d,e){if(m.getHashByUrl(d)&&m.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(e!==!1&&m.busy())return m.pushQueue({scope:m,callback:m.replaceState,args:arguments,queue:e}),!1;m.busy(!0);var f=m.createStateObject(b,c,d);return m.isLastSavedState(f)?m.busy(!1):(m.storeState(f),m.expectedStateId=f.id,n.replaceState(f.id,f.title,f.url),m.Adapter.trigger(a,"popstate")),!0};if(f){try{m.store=k.parse(f.getItem("History.store"))||{}}catch(p){m.store={}}m.normalizeStore()}else m.store={},m.normalizeStore();m.Adapter.bind(a,"beforeunload",m.clearAllIntervals),m.Adapter.bind(a,"unload",m.clearAllIntervals),m.saveState(m.storeState(m.extractState(d.location.href,!0))),f&&(m.onUnload=function(){var a,b;try{a=k.parse(f.getItem("History.store"))||{}}catch(c){a={}}a.idToState=a.idToState||{},a.urlToId=a.urlToId||{},a.stateToId=a.stateToId||{};for(b in m.idToState){if(!m.idToState.hasOwnProperty(b))continue;a.idToState[b]=m.idToState[b]}for(b in m.urlToId){if(!m.urlToId.hasOwnProperty(b))continue;a.urlToId[b]=m.urlToId[b]}for(b in m.stateToId){if(!m.stateToId.hasOwnProperty(b))continue;a.stateToId[b]=m.stateToId[b]}m.store=a,m.normalizeStore(),f.setItem("History.store",k.stringify(a))},m.intervalList.push(i(m.onUnload,m.options.storeInterval)),m.Adapter.bind(a,"beforeunload",m.onUnload),m.Adapter.bind(a,"unload",m.onUnload));if(!m.emulated.pushState){m.bugs.safariPoll&&m.intervalList.push(i(m.safariStatePoll,m.options.safariPollInterval));if(e.vendor==="Apple Computer, Inc."||(e.appCodeName||"")==="Mozilla")m.Adapter.bind(a,"hashchange",function(){m.Adapter.trigger(a,"popstate")}),m.getHash()&&m.Adapter.onDomLoad(function(){m.Adapter.trigger(a,"hashchange")})}},m.init()}(window)
\ No newline at end of file
diff --git a/vendor/assets/javascripts/jquery.sticky-kit.min.js b/vendor/assets/javascripts/jquery.sticky-kit.min.js
deleted file mode 100644
index e8bb207c5a5f096bafa3a694f88ae1ca1da6a839..0000000000000000000000000000000000000000
--- a/vendor/assets/javascripts/jquery.sticky-kit.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- Sticky-kit v1.1.1 | WTFPL | Leaf Corcoran 2014 | http://leafo.net
-*/
-(function(){var k,e;k=this.jQuery||window.jQuery;e=k(window);k.fn.stick_in_parent=function(d){var v,y,n,p,h,C,s,G,q,H;null==d&&(d={});s=d.sticky_class;y=d.inner_scrolling;C=d.recalc_every;h=d.parent;p=d.offset_top;n=d.spacer;v=d.bottoming;null==p&&(p=0);null==h&&(h=void 0);null==y&&(y=!0);null==s&&(s="is_stuck");null==v&&(v=!0);G=function(a,d,q,z,D,t,r,E){var u,F,m,A,c,f,B,w,x,g,b;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);f=a.parent();null!=h&&(f=f.closest(h));if(!f.length)throw"failed to find stick parent";
-u=m=!1;(g=null!=n?n&&a.closest(n):k(""))&&g.css("position",a.css("position"));B=function(){var c,e,l;if(!E&&(c=parseInt(f.css("border-top-width"),10),e=parseInt(f.css("padding-top"),10),d=parseInt(f.css("padding-bottom"),10),q=f.offset().top+c+e,z=f.height(),m&&(u=m=!1,null==n&&(a.insertAfter(g),g.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(s),l=!0),D=a.offset().top-parseInt(a.css("margin-top"),10)-p,t=a.outerHeight(!0),r=a.css("float"),g&&g.css({width:a.outerWidth(!0),
-height:t,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),l))return b()};B();if(t!==z)return A=void 0,c=p,x=C,b=function(){var b,k,l,h;if(!E&&(null!=x&&(--x,0>=x&&(x=C,B())),l=e.scrollTop(),null!=A&&(k=l-A),A=l,m?(v&&(h=l+t+c>z+q,u&&!h&&(u=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),lb&&!u&&(c-=k,c=Math.max(b-t,c),c=Math.min(p,c),m&&a.css({top:c+"px"})))):l>D&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(s),null==n&&(a.after(g),"left"!==r&&"right"!==r||g.append(a)),a.trigger("sticky_kit:stick")),m&&v&&(null==h&&(h=l+t+c>z+q),!u&&h)))return u=!0,"static"===f.css("position")&&f.css({position:"relative"}),a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},
-w=function(){B();return b()},F=function(){E=!0;e.off("touchmove",b);e.off("scroll",b);e.off("resize",w);k(document.body).off("sticky_kit:recalc",w);a.off("sticky_kit:detach",F);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});f.position("position","");if(m)return null==n&&("left"!==r&&"right"!==r||a.insertAfter(g),g.remove()),a.removeClass(s)},e.on("touchmove",b),e.on("scroll",b),e.on("resize",w),k(document.body).on("sticky_kit:recalc",w),a.on("sticky_kit:detach",F),setTimeout(b,
-0)}};q=0;for(H=this.length;q