Commit b3c6f0b2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents d5bb86b0 e9b00588
Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
- Fix "Import projects from" button to show the correct instructions (Stan Hu)
- Fix dots in Wiki slugs causing errors (Stan Hu)
- Fix OAuth2 issue importing a new project from GitHub and GitLab (Stan Hu)
- Update poltergeist to version 1.6.0 to support PhantomJS 2.0 (Zeger-Jan van de Weg)
- Fix cross references when usernames, milestones, or project names contain underscores (Stan Hu)
- Disable reference creation for comments surrounded by code/preformatted blocks (Stan Hu)
- enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger)
- extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger)
- Fix a link in the patch update guide
......
......@@ -104,7 +104,7 @@ class ProjectWiki
def page_title_and_dir(title)
title_array = title.split("/")
title = title_array.pop
[title.gsub(/\.[^.]*$/, ""), title_array.join("/")]
[title, title_array.join("/")]
end
def search_files(query)
......
......@@ -179,7 +179,8 @@ class WikiPage
if valid? && project_wiki.send(method, *args)
page_details = if method == :update_page
@page.path
# Use url_path instead of path to omit format extension
@page.url_path
else
title
end
......
......@@ -112,6 +112,6 @@
$ ->
$('.how_to_import_link').bind 'click', (e) ->
e.preventDefault()
import_modal = $(this).parent().find(".modal").show()
import_modal = $(this).next(".modal").show()
$('.modal-header .close').bind 'click', ->
$(".modal").hide()
......@@ -24,7 +24,7 @@ If you have local changes to your GitLab repository the script will stash them a
## 2. Run GitLab upgrade tool
Note: GitLab 7.9 adds nodejs as a dependency. GitLab 7.6 adds `libkrb5-dev` as a dependency (installed by default on Ubuntu and OSX). GitLab 7.2 adds `pkg-config` and `cmake` as dependency. Please check the dependencies in the [installation guide.](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies)
Note: GitLab 7.9 adds `nodejs` as a dependency. GitLab 7.6 adds `libkrb5-dev` as a dependency (installed by default on Ubuntu and OSX). GitLab 7.2 adds `pkg-config` and `cmake` as dependency. Please check the dependencies in the [installation guide.](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies)
# Starting with GitLab version 7.0 upgrader script has been moved to bin directory
cd /home/git/gitlab
......
@dashboard
Feature: New Project
Background:
Given I sign in as a user
And I own project "Shop"
And I visit dashboard page
@javascript
Scenario: I should see New projects page
Given I click "New project" link
Then I see "New project" page
When I click on "Import project from GitHub"
Then I see instructions on how to import from GitHub
class Spinach::Features::NewProject < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
step 'I click "New project" link' do
click_link "New project"
end
step 'I see "New project" page' do
page.should have_content("Project path")
end
step 'I click on "Import project from GitHub"' do
first('.how_to_import_link').click
end
step 'I see instructions on how to import from GitHub' do
github_modal = first('.modal-body')
github_modal.should be_visible
github_modal.should have_content "To enable importing projects from GitHub"
all('.modal-body').each do |element|
element.should_not be_visible unless element == github_modal
end
end
end
......@@ -92,7 +92,7 @@ module Gitlab
end
def bitbucket_options
OmniAuth::Strategies::Bitbucket.default_options[:client_options].dup
OmniAuth::Strategies::Bitbucket.default_options[:client_options].symbolize_keys
end
end
end
......
......@@ -46,7 +46,7 @@ module Gitlab
end
def github_options
OmniAuth::Strategies::GitHub.default_options[:client_options].dup
OmniAuth::Strategies::GitHub.default_options[:client_options].symbolize_keys
end
end
end
......
......@@ -71,7 +71,7 @@ module Gitlab
end
def gitlab_options
OmniAuth::Strategies::GitLab.default_options[:client_options].dup
OmniAuth::Strategies::GitLab.default_options[:client_options].symbolize_keys
end
end
end
......
......@@ -11,7 +11,13 @@ module Gitlab
end
def analyze(string, project)
parse_references(string.dup, project)
text = string.dup
# Remove preformatted/code blocks so that references are not included
text.gsub!(%r{<pre>.*?</pre>|<code>.*?</code>}m) { |match| '' }
text.gsub!(%r{^```.*?^```}m) { |match| '' }
parse_references(text, project)
end
# Given a valid project, resolve the extracted identifiers of the requested type to
......
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
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
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
......@@ -50,6 +50,26 @@ describe Gitlab::ReferenceExtractor do
expect(text).to eq('issue #123 is just the worst, @user')
end
it 'extracts no references for <pre>..</pre> blocks' do
subject.analyze("<pre>def puts '#1 issue'\nend\n</pre>```", nil)
expect(subject.issues).to be_blank
end
it 'extracts no references for <code>..</code> blocks' do
subject.analyze("<code>def puts '!1 request'\nend\n</code>```", nil)
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```", nil)
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```', nil)
expect(subject.issues).to eq([{ project: nil, id: '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)
......
......@@ -78,6 +78,47 @@ describe WikiPage do
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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment