master merged
This commit is contained in:
commit
e6ce47291b
269 changed files with 4223 additions and 2129 deletions
|
@ -31,6 +31,7 @@ describe GitlabMarkdownHelper do
|
|||
end
|
||||
|
||||
it "should not touch HTML entities" do
|
||||
@project.issues.stub(:where).with(id: '39').and_return([issue])
|
||||
actual = expected = "We'll accept good pull requests."
|
||||
gfm(actual).should == expected
|
||||
end
|
||||
|
@ -291,11 +292,18 @@ describe GitlabMarkdownHelper do
|
|||
actual = link_to_gfm("Fixed in #{commit.id}", commit_path, class: 'foo')
|
||||
actual.should have_selector 'a.gfm.gfm-commit.foo'
|
||||
end
|
||||
|
||||
it "escapes HTML passed in as the body" do
|
||||
actual = "This is a <h1>test</h1> - see ##{issues[0].id}"
|
||||
link_to_gfm(actual, commit_path).should match('<h1>test</h1>')
|
||||
end
|
||||
end
|
||||
|
||||
describe "#markdown" do
|
||||
it "should handle references in paragraphs" do
|
||||
markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should == "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to commit.id, project_commit_path(project, commit), title: commit.link_title, class: "gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
|
||||
actual = "\n\nLorem ipsum dolor sit amet. #{commit.id} Nam pulvinar sapien eget.\n"
|
||||
expected = project_commit_path(project, commit)
|
||||
markdown(actual).should match(expected)
|
||||
end
|
||||
|
||||
it "should handle references in headers" do
|
||||
|
|
95
spec/lib/auth_spec.rb
Normal file
95
spec/lib/auth_spec.rb
Normal file
|
@ -0,0 +1,95 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::Auth do
|
||||
let(:gl_auth) { Gitlab::Auth.new }
|
||||
|
||||
before do
|
||||
Gitlab.config.stub(omniauth: {})
|
||||
|
||||
@info = mock(
|
||||
uid: '12djsak321',
|
||||
name: 'John',
|
||||
email: 'john@mail.com'
|
||||
)
|
||||
end
|
||||
|
||||
describe :find_for_ldap_auth do
|
||||
before do
|
||||
@auth = mock(
|
||||
uid: '12djsak321',
|
||||
info: @info,
|
||||
provider: 'ldap'
|
||||
)
|
||||
end
|
||||
|
||||
it "should find by uid & provider" do
|
||||
User.should_receive :find_by_extern_uid_and_provider
|
||||
gl_auth.find_for_ldap_auth(@auth)
|
||||
end
|
||||
|
||||
it "should update credentials by email if missing uid" do
|
||||
user = double('User')
|
||||
User.stub find_by_extern_uid_and_provider: nil
|
||||
User.stub find_by_email: user
|
||||
user.should_receive :update_attributes
|
||||
gl_auth.find_for_ldap_auth(@auth)
|
||||
end
|
||||
|
||||
|
||||
it "should create from auth if user doesnot exist"do
|
||||
User.stub find_by_extern_uid_and_provider: nil
|
||||
User.stub find_by_email: nil
|
||||
gl_auth.should_receive :create_from_omniauth
|
||||
gl_auth.find_for_ldap_auth(@auth)
|
||||
end
|
||||
end
|
||||
|
||||
describe :find_or_new_for_omniauth do
|
||||
before do
|
||||
@auth = mock(
|
||||
info: @info,
|
||||
provider: 'twitter',
|
||||
uid: '12djsak321',
|
||||
)
|
||||
end
|
||||
|
||||
it "should find user"do
|
||||
User.should_receive :find_by_provider_and_extern_uid
|
||||
gl_auth.should_not_receive :create_from_omniauth
|
||||
gl_auth.find_or_new_for_omniauth(@auth)
|
||||
end
|
||||
|
||||
it "should not create user"do
|
||||
User.stub find_by_provider_and_extern_uid: nil
|
||||
gl_auth.should_not_receive :create_from_omniauth
|
||||
gl_auth.find_or_new_for_omniauth(@auth)
|
||||
end
|
||||
|
||||
it "should create user if single_sing_on"do
|
||||
Gitlab.config.omniauth['allow_single_sign_on'] = true
|
||||
User.stub find_by_provider_and_extern_uid: nil
|
||||
gl_auth.should_receive :create_from_omniauth
|
||||
gl_auth.find_or_new_for_omniauth(@auth)
|
||||
end
|
||||
end
|
||||
|
||||
describe :create_from_omniauth do
|
||||
it "should create user from LDAP" do
|
||||
@auth = mock(info: @info, provider: 'ldap')
|
||||
user = gl_auth.create_from_omniauth(@auth, true)
|
||||
|
||||
user.should be_valid
|
||||
user.extern_uid.should == @info.uid
|
||||
user.provider.should == 'ldap'
|
||||
end
|
||||
|
||||
it "should create user from Omniauth" do
|
||||
@auth = mock(info: @info, provider: 'twitter')
|
||||
user = gl_auth.create_from_omniauth(@auth, false)
|
||||
|
||||
user.should be_valid
|
||||
user.extern_uid.should == @info.uid
|
||||
user.provider.should == 'twitter'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -14,12 +14,12 @@ describe Event do
|
|||
it { should respond_to(:commits) }
|
||||
end
|
||||
|
||||
describe "Push event" do
|
||||
before do
|
||||
describe "Push event" do
|
||||
before do
|
||||
project = Factory :project
|
||||
@user = project.owner
|
||||
|
||||
data = {
|
||||
data = {
|
||||
before: "0000000000000000000000000000000000000000",
|
||||
after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
|
||||
ref: "refs/heads/master",
|
||||
|
@ -50,25 +50,24 @@ describe Event do
|
|||
it { @event.author.should == @user }
|
||||
end
|
||||
|
||||
describe "Joined project team" do
|
||||
let(:project) {Factory.create :project}
|
||||
let(:new_user) {Factory.create :user}
|
||||
it "should create event" do
|
||||
UsersProject.observers.enable :users_project_observer
|
||||
expect{
|
||||
UsersProject.bulk_import(project, [new_user.id], UsersProject::DEVELOPER)
|
||||
}.to change{Event.count}.by(1)
|
||||
describe 'Team events' do
|
||||
let(:user_project) { stub.as_null_object }
|
||||
let(:observer) { UsersProjectObserver.instance }
|
||||
|
||||
before {
|
||||
Event.should_receive :create
|
||||
}
|
||||
|
||||
describe "Joined project team" do
|
||||
it "should create event" do
|
||||
observer.after_create user_project
|
||||
end
|
||||
end
|
||||
end
|
||||
describe "Left project team" do
|
||||
let(:project) {Factory.create :project}
|
||||
let(:new_user) {Factory.create :user}
|
||||
it "should create event" do
|
||||
UsersProject.bulk_import(project, [new_user.id], UsersProject::DEVELOPER)
|
||||
UsersProject.observers.enable :users_project_observer
|
||||
expect{
|
||||
UsersProject.bulk_delete(project, [new_user.id])
|
||||
}.to change{Event.count}.by(1)
|
||||
|
||||
describe "Left project team" do
|
||||
it "should create event" do
|
||||
observer.after_destroy user_project
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ describe Issue do
|
|||
|
||||
describe 'modules' do
|
||||
it { should include_module(IssueCommonality) }
|
||||
it { should include_module(Upvote) }
|
||||
it { should include_module(Votes) }
|
||||
end
|
||||
|
||||
subject { Factory.create(:issue) }
|
||||
|
|
|
@ -8,6 +8,6 @@ describe MergeRequest do
|
|||
|
||||
describe 'modules' do
|
||||
it { should include_module(IssueCommonality) }
|
||||
it { should include_module(Upvote) }
|
||||
it { should include_module(Votes) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,13 @@ describe Note do
|
|||
it "recognizes a neutral note" do
|
||||
note = Factory(:note, note: "This is not a +1 note")
|
||||
note.should_not be_upvote
|
||||
note.should_not be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a neutral emoji note" do
|
||||
note = build(:note, note: "I would :+1: this, but I don't want to")
|
||||
note.should_not be_upvote
|
||||
note.should_not be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a +1 note" do
|
||||
|
@ -31,19 +38,19 @@ describe Note do
|
|||
note.should be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a -1 note as no vote" do
|
||||
note = Factory(:note, note: "-1 for this")
|
||||
note.should_not be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a +1 emoji as a vote" do
|
||||
note = build(:note, note: ":+1: for this")
|
||||
note.should be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a neutral emoji note" do
|
||||
note = build(:note, note: "I would :+1: this, but I don't want to")
|
||||
note.should_not be_upvote
|
||||
it "recognizes a -1 note" do
|
||||
note = Factory(:note, note: "-1 for this")
|
||||
note.should be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a -1 emoji as a vote" do
|
||||
note = build(:note, note: ":-1: for this")
|
||||
note.should be_downvote
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ describe UserObserver do
|
|||
end
|
||||
|
||||
context 'when a new user is created' do
|
||||
let(:user) { double(:user, id: 42, password: 'P@ssword!') }
|
||||
let(:user) { double(:user, id: 42, password: 'P@ssword!', name: 'John', email: 'u@mail.local') }
|
||||
let(:notification) { double :notification }
|
||||
|
||||
it 'sends an email' do
|
||||
|
@ -22,5 +22,10 @@ describe UserObserver do
|
|||
|
||||
subject.after_create(user)
|
||||
end
|
||||
|
||||
it 'trigger logger' do
|
||||
Gitlab::AppLogger.should_receive(:info)
|
||||
subject.after_create(user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe UsersProjectObserver do
|
||||
# let(:users_project) { stub.as_null_object }
|
||||
let(:user) { Factory.create :user }
|
||||
let(:project) { Factory.create(:project,
|
||||
code: "Fuu",
|
||||
|
@ -14,21 +15,23 @@ describe UsersProjectObserver do
|
|||
it "should called when UsersProject created" do
|
||||
subject.should_receive(:after_commit).once
|
||||
UsersProject.observers.enable :users_project_observer do
|
||||
Factory.create(:users_project,
|
||||
project: project,
|
||||
user: user)
|
||||
create(:users_project)
|
||||
end
|
||||
end
|
||||
|
||||
it "should send email to user" do
|
||||
Notify.should_receive(:project_access_granted_email).with(users_project.id).and_return(double(deliver: true))
|
||||
subject.after_commit(users_project)
|
||||
Event.stub(:create => true)
|
||||
end
|
||||
|
||||
it "should create new event" do
|
||||
Event.should_receive(:create).with(
|
||||
project_id: users_project.project.id,
|
||||
action: Event::Joined,
|
||||
project_id: users_project.project.id,
|
||||
action: Event::Joined,
|
||||
author_id: users_project.user.id
|
||||
)
|
||||
|
||||
subject.after_create(users_project)
|
||||
end
|
||||
end
|
||||
|
@ -37,9 +40,10 @@ describe UsersProjectObserver do
|
|||
it "should called when UsersProject updated" do
|
||||
subject.should_receive(:after_commit).once
|
||||
UsersProject.observers.enable :users_project_observer do
|
||||
users_project.update_attribute(:project_access, 40)
|
||||
create(:users_project).update_attribute(:project_access, UsersProject::MASTER)
|
||||
end
|
||||
end
|
||||
|
||||
it "should send email to user" do
|
||||
Notify.should_receive(:project_access_granted_email).with(users_project.id).and_return(double(deliver: true))
|
||||
subject.after_commit(users_project)
|
||||
|
@ -51,20 +55,20 @@ describe UsersProjectObserver do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#after_destroy" do
|
||||
it "should called when UsersProject destroyed" do
|
||||
subject.should_receive(:after_destroy)
|
||||
|
||||
UsersProject.observers.enable :users_project_observer do
|
||||
UsersProject.bulk_delete(
|
||||
users_project.project,
|
||||
[users_project.user.id]
|
||||
)
|
||||
create(:users_project).destroy
|
||||
end
|
||||
end
|
||||
|
||||
it "should create new event" do
|
||||
Event.should_receive(:create).with(
|
||||
project_id: users_project.project.id,
|
||||
action: Event::Left,
|
||||
project_id: users_project.project.id,
|
||||
action: Event::Left,
|
||||
author_id: users_project.user.id
|
||||
)
|
||||
subject.after_destroy(users_project)
|
||||
|
|
|
@ -9,12 +9,14 @@ describe Gitlab::API do
|
|||
before { project.add_access(user, :read) }
|
||||
|
||||
describe "GET /issues" do
|
||||
it "should return authentication error" do
|
||||
get api("/issues")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/issues")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /issues" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of issues" do
|
||||
get api("/issues", user)
|
||||
response.status.should == 200
|
||||
|
|
|
@ -6,6 +6,7 @@ describe Gitlab::API do
|
|||
let(:user) { Factory :user }
|
||||
let(:user2) { Factory.create(:user) }
|
||||
let(:user3) { Factory.create(:user) }
|
||||
let!(:hook) { Factory :project_hook, project: project, url: "http://example.com" }
|
||||
let!(:project) { Factory :project, owner: user }
|
||||
let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' }
|
||||
let!(:users_project) { Factory :users_project, user: user, project: project, project_access: UsersProject::MASTER }
|
||||
|
@ -13,12 +14,14 @@ describe Gitlab::API do
|
|||
before { project.add_access(user, :read) }
|
||||
|
||||
describe "GET /projects" do
|
||||
it "should return authentication error" do
|
||||
get api("/projects")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/projects")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /projects" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of projects" do
|
||||
get api("/projects", user)
|
||||
response.status.should == 200
|
||||
|
@ -85,7 +88,7 @@ describe Gitlab::API do
|
|||
it "should return a 404 error if not found" do
|
||||
get api("/projects/42", user)
|
||||
response.status.should == 404
|
||||
json_response['message'].should == '404 Not found'
|
||||
json_response['message'].should == '404 Not Found'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -147,6 +150,36 @@ describe Gitlab::API do
|
|||
end
|
||||
end
|
||||
|
||||
describe "GET /projects/:id/hooks" do
|
||||
it "should return project hooks" do
|
||||
get api("/projects/#{project.code}/hooks", user)
|
||||
|
||||
response.status.should == 200
|
||||
|
||||
json_response.should be_an Array
|
||||
json_response.count.should == 1
|
||||
json_response.first['url'].should == "http://example.com"
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /projects/:id/users" do
|
||||
it "should add hook to project" do
|
||||
expect {
|
||||
post api("/projects/#{project.code}/hooks", user),
|
||||
"url" => "http://example.com"
|
||||
}.to change {project.hooks.count}.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE /projects/:id/hooks" do
|
||||
it "should delete hook from project" do
|
||||
expect {
|
||||
delete api("/projects/#{project.code}/hooks", user),
|
||||
hook_id: hook.id
|
||||
}.to change {project.hooks.count}.by(-1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /projects/:id/repository/tags" do
|
||||
it "should return an array of project tags" do
|
||||
get api("/projects/#{project.code}/repository/tags", user)
|
||||
|
|
73
spec/requests/api/ssh_keys_spec.rb
Normal file
73
spec/requests/api/ssh_keys_spec.rb
Normal file
|
@ -0,0 +1,73 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::Keys do
|
||||
include ApiHelpers
|
||||
let(:user) {
|
||||
user = Factory.create :user
|
||||
user.reset_authentication_token!
|
||||
user
|
||||
}
|
||||
let(:key) { Factory.create :key, { user: user}}
|
||||
|
||||
describe "GET /keys" do
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/keys")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
context "when authenticated" do
|
||||
it "should return array of ssh keys" do
|
||||
user.keys << key
|
||||
user.save
|
||||
get api("/keys", user)
|
||||
response.status.should == 200
|
||||
json_response.should be_an Array
|
||||
json_response.first["title"].should == key.title
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /keys/:id" do
|
||||
it "should returm single key" do
|
||||
user.keys << key
|
||||
user.save
|
||||
get api("/keys/#{key.id}", user)
|
||||
response.status.should == 200
|
||||
json_response["title"].should == key.title
|
||||
end
|
||||
it "should return 404 Not Found within invalid ID" do
|
||||
get api("/keys/42", user)
|
||||
response.status.should == 404
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /keys" do
|
||||
it "should not create invalid ssh key" do
|
||||
post api("/keys", user), { title: "invalid key" }
|
||||
response.status.should == 404
|
||||
end
|
||||
it "should create ssh key" do
|
||||
key_attrs = Factory.attributes :key
|
||||
expect {
|
||||
post api("/keys", user), key_attrs
|
||||
}.to change{ user.keys.count }.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE /keys/:id" do
|
||||
it "should delete existed key" do
|
||||
user.keys << key
|
||||
user.save
|
||||
expect {
|
||||
delete api("/keys/#{key.id}", user)
|
||||
}.to change{user.keys.count}.by(-1)
|
||||
end
|
||||
it "should return 404 Not Found within invalid ID" do
|
||||
delete api("/keys/42", user)
|
||||
response.status.should == 404
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -6,12 +6,14 @@ describe Gitlab::API do
|
|||
let(:user) { Factory :user }
|
||||
|
||||
describe "GET /users" do
|
||||
it "should return authentication error" do
|
||||
get api("/users")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/users")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /users" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of users" do
|
||||
get api("/users", user)
|
||||
response.status.should == 200
|
||||
|
|
|
@ -1,42 +1,23 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "User Issues Dashboard" do
|
||||
describe "Dashboard Issues Feed" do
|
||||
describe "GET /issues" do
|
||||
before do
|
||||
let!(:user) { Factory :user }
|
||||
let!(:project1) { Factory :project }
|
||||
let!(:project2) { Factory :project }
|
||||
let!(:issue1) { Factory :issue, author: user, assignee: user, project: project1 }
|
||||
let!(:issue2) { Factory :issue, author: user, assignee: user, project: project2 }
|
||||
|
||||
login_as :user
|
||||
|
||||
@project1 = Factory :project
|
||||
|
||||
@project2 = Factory :project
|
||||
|
||||
@project1.add_access(@user, :read, :write)
|
||||
@project2.add_access(@user, :read, :write)
|
||||
|
||||
@issue1 = Factory :issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: @project1
|
||||
|
||||
@issue2 = Factory :issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: @project2
|
||||
|
||||
visit dashboard_issues_path
|
||||
end
|
||||
|
||||
describe "atom feed", js: false do
|
||||
describe "atom feed" do
|
||||
it "should render atom feed via private token" do
|
||||
logout
|
||||
visit dashboard_issues_path(:atom, private_token: @user.private_token)
|
||||
visit dashboard_issues_path(:atom, private_token: user.private_token)
|
||||
|
||||
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
||||
page.body.should have_selector("title", text: "#{@user.name} issues")
|
||||
page.body.should have_selector("author email", text: @issue1.author_email)
|
||||
page.body.should have_selector("entry summary", text: @issue1.title)
|
||||
page.body.should have_selector("author email", text: @issue2.author_email)
|
||||
page.body.should have_selector("entry summary", text: @issue2.title)
|
||||
page.body.should have_selector("title", text: "#{user.name} issues")
|
||||
page.body.should have_selector("author email", text: issue1.author_email)
|
||||
page.body.should have_selector("entry summary", text: issue1.title)
|
||||
page.body.should have_selector("author email", text: issue2.author_email)
|
||||
page.body.should have_selector("entry summary", text: issue2.title)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "User Dashboard" do
|
||||
before { login_as :user }
|
||||
|
||||
describe "Dashboard Feed" do
|
||||
describe "GET /" do
|
||||
before do
|
||||
@project = Factory :project, owner: @user
|
||||
@project.add_access(@user, :read)
|
||||
visit dashboard_path
|
||||
let!(:user) { Factory :user }
|
||||
|
||||
context "projects atom feed via private token" do
|
||||
it "should render projects atom feed" do
|
||||
visit dashboard_path(:atom, private_token: user.private_token)
|
||||
page.body.should have_selector("feed title")
|
||||
end
|
||||
end
|
||||
|
||||
it "should render projects atom feed via private token" do
|
||||
logout
|
||||
|
||||
visit dashboard_path(:atom, private_token: @user.private_token)
|
||||
page.body.should have_selector("feed title")
|
||||
end
|
||||
|
||||
it "should not render projects page via private token" do
|
||||
logout
|
||||
|
||||
visit dashboard_path(private_token: @user.private_token)
|
||||
current_path.should == new_user_session_path
|
||||
context "projects page via private token" do
|
||||
it "should redirect to login page" do
|
||||
visit dashboard_path(private_token: user.private_token)
|
||||
current_path.should == new_user_session_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,40 +1,34 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Issues" do
|
||||
let(:project) { Factory :project }
|
||||
|
||||
before do
|
||||
login_as :user
|
||||
project.add_access(@user, :read, :write)
|
||||
end
|
||||
|
||||
describe "Issues Feed" do
|
||||
describe "GET /issues" do
|
||||
before do
|
||||
@issue = Factory :issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project
|
||||
let!(:user) { Factory :user }
|
||||
let!(:project) { Factory :project, owner: user }
|
||||
let!(:issue) { Factory :issue, author: user, project: project }
|
||||
|
||||
visit project_issues_path(project)
|
||||
before { project.add_access(user, :read, :write) }
|
||||
|
||||
context "when authenticated" do
|
||||
it "should render atom feed" do
|
||||
login_with user
|
||||
visit project_issues_path(project, :atom)
|
||||
|
||||
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
||||
page.body.should have_selector("title", text: "#{project.name} issues")
|
||||
page.body.should have_selector("author email", text: issue.author_email)
|
||||
page.body.should have_selector("entry summary", text: issue.title)
|
||||
end
|
||||
end
|
||||
|
||||
it "should render atom feed" do
|
||||
visit project_issues_path(project, :atom)
|
||||
context "when authenticated via private token" do
|
||||
it "should render atom feed" do
|
||||
visit project_issues_path(project, :atom, private_token: user.private_token)
|
||||
|
||||
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
||||
page.body.should have_selector("title", text: "#{project.name} issues")
|
||||
page.body.should have_selector("author email", text: @issue.author_email)
|
||||
page.body.should have_selector("entry summary", text: @issue.title)
|
||||
end
|
||||
|
||||
it "should render atom feed via private token" do
|
||||
logout
|
||||
visit project_issues_path(project, :atom, private_token: @user.private_token)
|
||||
|
||||
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
||||
page.body.should have_selector("title", text: "#{project.name} issues")
|
||||
page.body.should have_selector("author email", text: @issue.author_email)
|
||||
page.body.should have_selector("entry summary", text: @issue.title)
|
||||
page.response_headers['Content-Type'].should have_content("application/atom+xml")
|
||||
page.body.should have_selector("title", text: "#{project.name} issues")
|
||||
page.body.should have_selector("author email", text: issue.author_email)
|
||||
page.body.should have_selector("entry summary", text: issue.title)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,6 +25,7 @@ describe "Gitlab Flavored Markdown" do
|
|||
@tag_name = "gfm-test-tag"
|
||||
r.git.native(:tag, {}, @tag_name, commit.id)
|
||||
end
|
||||
|
||||
after do
|
||||
# delete test branch and tag
|
||||
project.repo.git.native(:branch, {D: true}, @branch_name)
|
||||
|
|
|
@ -28,8 +28,8 @@ describe "Users Security" do
|
|||
it { should be_denied_for :visitor }
|
||||
end
|
||||
|
||||
describe "GET /profile/password" do
|
||||
subject { profile_password_path }
|
||||
describe "GET /profile/account" do
|
||||
subject { profile_account_path }
|
||||
|
||||
it { should be_allowed_for @u1 }
|
||||
it { should be_allowed_for :admin }
|
||||
|
|
|
@ -70,7 +70,7 @@ describe "Application access" do
|
|||
end
|
||||
|
||||
describe "GET /project_code/team" do
|
||||
subject { team_project_path(@project) }
|
||||
subject { project_team_index_path(@project) }
|
||||
|
||||
it { should be_allowed_for @u1 }
|
||||
it { should be_allowed_for @u3 }
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Issue, "Upvote" do
|
||||
let(:issue) { create(:issue) }
|
||||
|
||||
it "with no notes has a 0/0 score" do
|
||||
issue.upvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize non-+1 notes" do
|
||||
issue.notes << create(:note, note: "No +1 here")
|
||||
issue.should have(1).note
|
||||
issue.notes.first.upvote?.should be_false
|
||||
issue.upvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize a single +1 note" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.upvotes.should == 1
|
||||
end
|
||||
|
||||
it "should recognize multiple +1 notes" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.upvotes.should == 2
|
||||
end
|
||||
end
|
132
spec/roles/votes_spec.rb
Normal file
132
spec/roles/votes_spec.rb
Normal file
|
@ -0,0 +1,132 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Issue do
|
||||
let(:issue) { create(:issue) }
|
||||
|
||||
describe "#upvotes" do
|
||||
it "with no notes has a 0/0 score" do
|
||||
issue.upvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize non-+1 notes" do
|
||||
issue.notes << create(:note, note: "No +1 here")
|
||||
issue.should have(1).note
|
||||
issue.notes.first.upvote?.should be_false
|
||||
issue.upvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize a single +1 note" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.upvotes.should == 1
|
||||
end
|
||||
|
||||
it "should recognize multiple +1 notes" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.upvotes.should == 2
|
||||
end
|
||||
end
|
||||
|
||||
describe "#downvotes" do
|
||||
it "with no notes has a 0/0 score" do
|
||||
issue.downvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize non--1 notes" do
|
||||
issue.notes << create(:note, note: "Almost got a -1")
|
||||
issue.should have(1).note
|
||||
issue.notes.first.downvote?.should be_false
|
||||
issue.downvotes.should == 0
|
||||
end
|
||||
|
||||
it "should recognize a single -1 note" do
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.downvotes.should == 1
|
||||
end
|
||||
|
||||
it "should recognize multiple -1 notes" do
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.notes << create(:note, note: "-1 Away with this")
|
||||
issue.downvotes.should == 2
|
||||
end
|
||||
end
|
||||
|
||||
describe "#votes_count" do
|
||||
it "with no notes has a 0/0 score" do
|
||||
issue.votes_count.should == 0
|
||||
end
|
||||
|
||||
it "should recognize non notes" do
|
||||
issue.notes << create(:note, note: "No +1 here")
|
||||
issue.should have(1).note
|
||||
issue.votes_count.should == 0
|
||||
end
|
||||
|
||||
it "should recognize a single +1 note" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.votes_count.should == 1
|
||||
end
|
||||
|
||||
it "should recognize a single -1 note" do
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.votes_count.should == 1
|
||||
end
|
||||
|
||||
it "should recognize multiple notes" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.votes_count.should == 3
|
||||
end
|
||||
end
|
||||
|
||||
describe "#upvotes_in_percent" do
|
||||
it "with no notes has a 0% score" do
|
||||
issue.upvotes_in_percent.should == 0
|
||||
end
|
||||
|
||||
it "should count a single 1 note as 100%" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.upvotes_in_percent.should == 100
|
||||
end
|
||||
|
||||
it "should count multiple +1 notes as 100%" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.upvotes_in_percent.should == 100
|
||||
end
|
||||
|
||||
it "should count fractions for multiple +1 and -1 notes correctly" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.notes << create(:note, note: "+1 me too")
|
||||
issue.upvotes_in_percent.should == 75
|
||||
end
|
||||
end
|
||||
|
||||
describe "#downvotes_in_percent" do
|
||||
it "with no notes has a 0% score" do
|
||||
issue.downvotes_in_percent.should == 0
|
||||
end
|
||||
|
||||
it "should count a single -1 note as 100%" do
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.downvotes_in_percent.should == 100
|
||||
end
|
||||
|
||||
it "should count multiple -1 notes as 100%" do
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.notes << create(:note, note: "-1 Away with this")
|
||||
issue.downvotes_in_percent.should == 100
|
||||
end
|
||||
|
||||
it "should count fractions for multiple +1 and -1 notes correctly" do
|
||||
issue.notes << create(:note, note: "+1 This is awesome")
|
||||
issue.notes << create(:note, note: "+1 I want this")
|
||||
issue.notes << create(:note, note: "-1 This is bad")
|
||||
issue.notes << create(:note, note: "+1 me too")
|
||||
issue.downvotes_in_percent.should == 25
|
||||
end
|
||||
end
|
||||
end
|
166
spec/routing/admin_routing_spec.rb
Normal file
166
spec/routing/admin_routing_spec.rb
Normal file
|
@ -0,0 +1,166 @@
|
|||
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
|
||||
put("/admin/users/1/team_update").should route_to('admin/users#team_update', id: '1')
|
||||
end
|
||||
|
||||
it "to #block" do
|
||||
put("/admin/users/1/block").should route_to('admin/users#block', id: '1')
|
||||
end
|
||||
|
||||
it "to #unblock" do
|
||||
put("/admin/users/1/unblock").should route_to('admin/users#unblock', id: '1')
|
||||
end
|
||||
|
||||
it "to #index" do
|
||||
get("/admin/users").should route_to('admin/users#index')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/admin/users/1").should route_to('admin/users#show', id: '1')
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/admin/users").should route_to('admin/users#create')
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/admin/users/new").should route_to('admin/users#new')
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/admin/users/1/edit").should route_to('admin/users#edit', id: '1')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/admin/users/1").should route_to('admin/users#show', id: '1')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/admin/users/1").should route_to('admin/users#update', id: '1')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/admin/users/1").should 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 #team" do
|
||||
get("/admin/projects/gitlab/team").should route_to('admin/projects#team', id: 'gitlab')
|
||||
end
|
||||
|
||||
it "to #team_update" do
|
||||
put("/admin/projects/gitlab/team_update").should route_to('admin/projects#team_update', id: 'gitlab')
|
||||
end
|
||||
|
||||
it "to #index" do
|
||||
get("/admin/projects").should route_to('admin/projects#index')
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/admin/projects").should route_to('admin/projects#create')
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/admin/projects/new").should route_to('admin/projects#new')
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/admin/projects/gitlab/edit").should route_to('admin/projects#edit', id: 'gitlab')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/admin/projects/gitlab").should route_to('admin/projects#show', id: 'gitlab')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/admin/projects/gitlab").should route_to('admin/projects#update', id: 'gitlab')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/admin/projects/gitlab").should route_to('admin/projects#destroy', id: 'gitlab')
|
||||
end
|
||||
end
|
||||
|
||||
# edit_admin_team_member GET /admin/team_members/:id/edit(.:format) admin/team_members#edit
|
||||
# admin_team_member PUT /admin/team_members/:id(.:format) admin/team_members#update
|
||||
# DELETE /admin/team_members/:id(.:format) admin/team_members#destroy
|
||||
describe Admin::TeamMembersController, "routing" do
|
||||
it "to #edit" do
|
||||
get("/admin/team_members/1/edit").should route_to('admin/team_members#edit', id: '1')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/admin/team_members/1").should route_to('admin/team_members#update', id: '1')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/admin/team_members/1").should route_to('admin/team_members#destroy', id: '1')
|
||||
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
|
||||
get("/admin/hooks/1/test").should route_to('admin/hooks#test', hook_id: '1')
|
||||
end
|
||||
|
||||
it "to #index" do
|
||||
get("/admin/hooks").should route_to('admin/hooks#index')
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/admin/hooks").should route_to('admin/hooks#create')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/admin/hooks/1").should 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
|
||||
get("/admin/logs").should route_to('admin/logs#show')
|
||||
end
|
||||
end
|
||||
|
||||
# admin_resque GET /admin/resque(.:format) admin/resque#show
|
||||
describe Admin::ResqueController, "routing" do
|
||||
it "to #show" do
|
||||
get("/admin/resque").should route_to('admin/resque#show')
|
||||
end
|
||||
end
|
||||
|
||||
# admin_root /admin(.:format) admin/dashboard#index
|
||||
describe Admin::DashboardController, "routing" do
|
||||
it "to #index" do
|
||||
get("/admin").should route_to('admin/dashboard#index')
|
||||
end
|
||||
end
|
||||
|
398
spec/routing/project_routing_spec.rb
Normal file
398
spec/routing/project_routing_spec.rb
Normal file
|
@ -0,0 +1,398 @@
|
|||
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
|
||||
get("/gitlabhq/#{controller}").should route_to("#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index)
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/gitlabhq/#{controller}").should route_to("#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create)
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/gitlabhq/#{controller}/new").should route_to("#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new)
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/gitlabhq/#{controller}/1/edit").should route_to("#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit)
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/gitlabhq/#{controller}/1").should route_to("#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show)
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/gitlabhq/#{controller}/1").should route_to("#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update)
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/gitlabhq/#{controller}/1").should route_to("#{controller}#destroy", 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
|
||||
# wall_project GET /:id/wall(.:format) projects#wall
|
||||
# graph_project GET /:id/graph(.:format) projects#graph
|
||||
# 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
|
||||
describe ProjectsController, "routing" do
|
||||
it "to #create" do
|
||||
post("/projects").should route_to('projects#create')
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/projects/new").should route_to('projects#new')
|
||||
end
|
||||
|
||||
it "to #wall" do
|
||||
get("/gitlabhq/wall").should route_to('projects#wall', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #graph" do
|
||||
get("/gitlabhq/graph").should route_to('projects#graph', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #files" do
|
||||
get("/gitlabhq/files").should route_to('projects#files', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/gitlabhq/edit").should route_to('projects#edit', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/gitlabhq").should route_to('projects#show', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/gitlabhq").should route_to('projects#update', id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/gitlabhq").should route_to('projects#destroy', id: 'gitlabhq')
|
||||
end
|
||||
end
|
||||
|
||||
# pages_project_wikis GET /:project_id/wikis/pages(.:format) wikis#pages
|
||||
# history_project_wiki GET /:project_id/wikis/:id/history(.:format) wikis#history
|
||||
# project_wikis POST /:project_id/wikis(.:format) wikis#create
|
||||
# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) wikis#edit
|
||||
# project_wiki GET /:project_id/wikis/:id(.:format) wikis#show
|
||||
# DELETE /:project_id/wikis/:id(.:format) wikis#destroy
|
||||
describe WikisController, "routing" do
|
||||
it "to #pages" do
|
||||
get("/gitlabhq/wikis/pages").should route_to('wikis#pages', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #history" do
|
||||
get("/gitlabhq/wikis/1/history").should route_to('wikis#history', 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) repositories#branches
|
||||
# tags_project_repository GET /:project_id/repository/tags(.:format) repositories#tags
|
||||
# archive_project_repository GET /:project_id/repository/archive(.:format) repositories#archive
|
||||
# project_repository POST /:project_id/repository(.:format) repositories#create
|
||||
# new_project_repository GET /:project_id/repository/new(.:format) repositories#new
|
||||
# edit_project_repository GET /:project_id/repository/edit(.:format) repositories#edit
|
||||
# GET /:project_id/repository(.:format) repositories#show
|
||||
# PUT /:project_id/repository(.:format) repositories#update
|
||||
# DELETE /:project_id/repository(.:format) repositories#destroy
|
||||
describe RepositoriesController, "routing" do
|
||||
it "to #branches" do
|
||||
get("/gitlabhq/repository/branches").should route_to('repositories#branches', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #tags" do
|
||||
get("/gitlabhq/repository/tags").should route_to('repositories#tags', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #archive" do
|
||||
get("/gitlabhq/repository/archive").should route_to('repositories#archive', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/gitlabhq/repository").should route_to('repositories#create', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/gitlabhq/repository/new").should route_to('repositories#new', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/gitlabhq/repository/edit").should route_to('repositories#edit', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/gitlabhq/repository").should route_to('repositories#show', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/gitlabhq/repository").should route_to('repositories#update', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/gitlabhq/repository").should route_to('repositories#destroy', project_id: 'gitlabhq')
|
||||
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
|
||||
# edit_project_deploy_key GET /:project_id/deploy_keys/:id/edit(.:format) deploy_keys#edit
|
||||
# project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show
|
||||
# PUT /:project_id/deploy_keys/:id(.:format) deploy_keys#update
|
||||
# DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy
|
||||
describe DeployKeysController, "routing" do
|
||||
it_behaves_like "RESTful project resources" do
|
||||
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 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/switch(.:format) refs#switch
|
||||
# tree_project_ref GET /:project_id/:id/tree(.:format) refs#tree
|
||||
# logs_tree_project_ref GET /:project_id/:id/logs_tree(.:format) refs#logs_tree
|
||||
# blob_project_ref GET /:project_id/:id/blob(.:format) refs#blob
|
||||
# tree_file_project_ref GET /:project_id/:id/tree/:path(.:format) refs#tree
|
||||
# logs_file_project_ref GET /:project_id/:id/logs_tree/:path(.:format) refs#logs_tree
|
||||
# blame_file_project_ref GET /:project_id/:id/blame/:path(.:format) refs#blame
|
||||
describe RefsController, "routing" do
|
||||
it "to #switch" do
|
||||
get("/gitlabhq/switch").should route_to('refs#switch', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #tree" do
|
||||
get("/gitlabhq/stable/tree").should route_to('refs#tree', project_id: 'gitlabhq', id: 'stable')
|
||||
get("/gitlabhq/stable/tree/foo/bar/baz").should route_to('refs#tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
|
||||
end
|
||||
|
||||
it "to #logs_tree" do
|
||||
get("/gitlabhq/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable')
|
||||
get("/gitlabhq/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
|
||||
end
|
||||
|
||||
it "to #blob" do
|
||||
get("/gitlabhq/stable/blob").should route_to('refs#blob', project_id: 'gitlabhq', id: 'stable')
|
||||
end
|
||||
|
||||
it "to #blame" do
|
||||
get("/gitlabhq/stable/blame/foo/bar/baz").should route_to('refs#blame', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
|
||||
end
|
||||
end
|
||||
|
||||
# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) merge_requests#diffs
|
||||
# automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) merge_requests#automerge
|
||||
# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) merge_requests#automerge_check
|
||||
# raw_project_merge_request GET /:project_id/merge_requests/:id/raw(.:format) merge_requests#raw
|
||||
# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) merge_requests#branch_from
|
||||
# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) merge_requests#branch_to
|
||||
# project_merge_requests GET /:project_id/merge_requests(.:format) merge_requests#index
|
||||
# POST /:project_id/merge_requests(.:format) merge_requests#create
|
||||
# new_project_merge_request GET /:project_id/merge_requests/new(.:format) merge_requests#new
|
||||
# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) merge_requests#edit
|
||||
# project_merge_request GET /:project_id/merge_requests/:id(.:format) merge_requests#show
|
||||
# PUT /:project_id/merge_requests/:id(.:format) merge_requests#update
|
||||
# DELETE /:project_id/merge_requests/:id(.:format) merge_requests#destroy
|
||||
describe MergeRequestsController, "routing" do
|
||||
it "to #diffs" do
|
||||
get("/gitlabhq/merge_requests/1/diffs").should route_to('merge_requests#diffs', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it "to #automerge" do
|
||||
get("/gitlabhq/merge_requests/1/automerge").should route_to('merge_requests#automerge', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it "to #automerge_check" do
|
||||
get("/gitlabhq/merge_requests/1/automerge_check").should route_to('merge_requests#automerge_check', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it "to #raw" do
|
||||
get("/gitlabhq/merge_requests/1/raw").should route_to('merge_requests#raw', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it "to #branch_from" do
|
||||
get("/gitlabhq/merge_requests/branch_from").should route_to('merge_requests#branch_from', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #branch_to" do
|
||||
get("/gitlabhq/merge_requests/branch_to").should route_to('merge_requests#branch_to', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'merge_requests' }
|
||||
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
|
||||
get("/gitlabhq/snippets/1/raw").should route_to('snippets#raw', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'snippets' }
|
||||
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 HooksController, "routing" do
|
||||
it "to #test" do
|
||||
get("/gitlabhq/hooks/1/test").should route_to('hooks#test', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:actions) { [:index, :create, :destroy] }
|
||||
let(:controller) { 'hooks' }
|
||||
end
|
||||
end
|
||||
|
||||
# compare_project_commits GET /:project_id/commits/compare(.:format) commits#compare
|
||||
# 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
|
||||
# new_project_commit GET /:project_id/commits/new(.:format) commits#new
|
||||
# edit_project_commit GET /:project_id/commits/:id/edit(.:format) commits#edit
|
||||
# project_commit GET /:project_id/commits/:id(.:format) commits#show
|
||||
# PUT /:project_id/commits/:id(.:format) commits#update
|
||||
# DELETE /:project_id/commits/:id(.:format) commits#destroy
|
||||
describe CommitsController, "routing" do
|
||||
it "to #compare" do
|
||||
get("/gitlabhq/commits/compare").should route_to('commits#compare', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #patch" do
|
||||
get("/gitlabhq/commits/1/patch").should route_to('commits#patch', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'commits' }
|
||||
end
|
||||
end
|
||||
|
||||
# project_team_members GET /:project_id/team_members(.:format) team_members#index
|
||||
# POST /:project_id/team_members(.:format) team_members#create
|
||||
# new_project_team_member GET /:project_id/team_members/new(.:format) team_members#new
|
||||
# edit_project_team_member GET /:project_id/team_members/:id/edit(.:format) team_members#edit
|
||||
# project_team_member GET /:project_id/team_members/:id(.:format) team_members#show
|
||||
# PUT /:project_id/team_members/:id(.:format) team_members#update
|
||||
# DELETE /:project_id/team_members/:id(.:format) team_members#destroy
|
||||
describe TeamMembersController, "routing" do
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'team_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 MilestonesController, "routing" do
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'milestones' }
|
||||
end
|
||||
end
|
||||
|
||||
# project_labels GET /:project_id/labels(.:format) labels#index
|
||||
describe LabelsController, "routing" do
|
||||
it "to #index" do
|
||||
get("/gitlabhq/labels").should route_to('labels#index', 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 IssuesController, "routing" do
|
||||
it "to #sort" do
|
||||
post("/gitlabhq/issues/sort").should route_to('issues#sort', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #bulk_update" do
|
||||
post("/gitlabhq/issues/bulk_update").should route_to('issues#bulk_update', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it "to #search" do
|
||||
get("/gitlabhq/issues/search").should route_to('issues#search', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:controller) { 'issues' }
|
||||
end
|
||||
end
|
||||
|
||||
# preview_project_notes POST /:project_id/notes/preview(.:format) notes#preview
|
||||
# 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 NotesController, "routing" do
|
||||
it "to #preview" do
|
||||
post("/gitlabhq/notes/preview").should route_to('notes#preview', project_id: 'gitlabhq')
|
||||
end
|
||||
|
||||
it_behaves_like "RESTful project resources" do
|
||||
let(:actions) { [:index, :create, :destroy] }
|
||||
let(:controller) { 'notes' }
|
||||
end
|
||||
end
|
186
spec/routing/routing_spec.rb
Normal file
186
spec/routing/routing_spec.rb
Normal file
|
@ -0,0 +1,186 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# search GET /search(.:format) search#show
|
||||
describe SearchController, "routing" do
|
||||
it "to #show" do
|
||||
get("/search").should route_to('search#show')
|
||||
end
|
||||
end
|
||||
|
||||
# gitlab_api /api Gitlab::API
|
||||
# resque /info/resque Resque::Server
|
||||
# /:path Grack
|
||||
describe "Mounted Apps", "routing" do
|
||||
it "to API" do
|
||||
get("/api").should be_routable
|
||||
end
|
||||
|
||||
it "to Resque" do
|
||||
pending
|
||||
get("/info/resque").should be_routable
|
||||
end
|
||||
|
||||
it "to Grack" do
|
||||
get("/gitlabhq.git").should be_routable
|
||||
end
|
||||
end
|
||||
|
||||
# help GET /help(.:format) help#index
|
||||
# help_permissions GET /help/permissions(.:format) help#permissions
|
||||
# help_workflow GET /help/workflow(.:format) help#workflow
|
||||
# help_api GET /help/api(.:format) help#api
|
||||
# help_web_hooks GET /help/web_hooks(.:format) help#web_hooks
|
||||
# help_system_hooks GET /help/system_hooks(.:format) help#system_hooks
|
||||
# help_markdown GET /help/markdown(.:format) help#markdown
|
||||
# help_ssh GET /help/ssh(.:format) help#ssh
|
||||
describe HelpController, "routing" do
|
||||
it "to #index" do
|
||||
get("/help").should route_to('help#index')
|
||||
end
|
||||
|
||||
it "to #permissions" do
|
||||
get("/help/permissions").should route_to('help#permissions')
|
||||
end
|
||||
|
||||
it "to #workflow" do
|
||||
get("/help/workflow").should route_to('help#workflow')
|
||||
end
|
||||
|
||||
it "to #api" do
|
||||
get("/help/api").should route_to('help#api')
|
||||
end
|
||||
|
||||
it "to #web_hooks" do
|
||||
get("/help/web_hooks").should route_to('help#web_hooks')
|
||||
end
|
||||
|
||||
it "to #system_hooks" do
|
||||
get("/help/system_hooks").should route_to('help#system_hooks')
|
||||
end
|
||||
|
||||
it "to #markdown" do
|
||||
get("/help/markdown").should route_to('help#markdown')
|
||||
end
|
||||
|
||||
it "to #ssh" do
|
||||
get("/help/ssh").should route_to('help#ssh')
|
||||
end
|
||||
end
|
||||
|
||||
# errors_githost GET /errors/githost(.:format) errors#githost
|
||||
describe ErrorsController, "routing" do
|
||||
it "to #githost" do
|
||||
get("/errors/githost").should route_to('errors#githost')
|
||||
end
|
||||
end
|
||||
|
||||
# profile_account GET /profile/account(.:format) profile#account
|
||||
# profile_history GET /profile/history(.:format) profile#history
|
||||
# profile_password PUT /profile/password(.:format) profile#password_update
|
||||
# profile_token GET /profile/token(.:format) profile#token
|
||||
# profile_reset_private_token PUT /profile/reset_private_token(.:format) profile#reset_private_token
|
||||
# profile GET /profile(.:format) profile#show
|
||||
# profile_design GET /profile/design(.:format) profile#design
|
||||
# profile_update PUT /profile/update(.:format) profile#update
|
||||
describe ProfileController, "routing" do
|
||||
it "to #account" do
|
||||
get("/profile/account").should route_to('profile#account')
|
||||
end
|
||||
|
||||
it "to #history" do
|
||||
get("/profile/history").should route_to('profile#history')
|
||||
end
|
||||
|
||||
it "to #password_update" do
|
||||
put("/profile/password").should route_to('profile#password_update')
|
||||
end
|
||||
|
||||
it "to #token" do
|
||||
get("/profile/token").should route_to('profile#token')
|
||||
end
|
||||
|
||||
it "to #reset_private_token" do
|
||||
put("/profile/reset_private_token").should route_to('profile#reset_private_token')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/profile").should route_to('profile#show')
|
||||
end
|
||||
|
||||
it "to #design" do
|
||||
get("/profile/design").should route_to('profile#design')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/profile/update").should route_to('profile#update')
|
||||
end
|
||||
end
|
||||
|
||||
# keys GET /keys(.:format) keys#index
|
||||
# POST /keys(.:format) keys#create
|
||||
# new_key GET /keys/new(.:format) keys#new
|
||||
# edit_key GET /keys/:id/edit(.:format) keys#edit
|
||||
# key GET /keys/:id(.:format) keys#show
|
||||
# PUT /keys/:id(.:format) keys#update
|
||||
# DELETE /keys/:id(.:format) keys#destroy
|
||||
describe KeysController, "routing" do
|
||||
it "to #index" do
|
||||
get("/keys").should route_to('keys#index')
|
||||
end
|
||||
|
||||
it "to #create" do
|
||||
post("/keys").should route_to('keys#create')
|
||||
end
|
||||
|
||||
it "to #new" do
|
||||
get("/keys/new").should route_to('keys#new')
|
||||
end
|
||||
|
||||
it "to #edit" do
|
||||
get("/keys/1/edit").should route_to('keys#edit', id: '1')
|
||||
end
|
||||
|
||||
it "to #show" do
|
||||
get("/keys/1").should route_to('keys#show', id: '1')
|
||||
end
|
||||
|
||||
it "to #update" do
|
||||
put("/keys/1").should route_to('keys#update', id: '1')
|
||||
end
|
||||
|
||||
it "to #destroy" do
|
||||
delete("/keys/1").should route_to('keys#destroy', id: '1')
|
||||
end
|
||||
end
|
||||
|
||||
# dashboard GET /dashboard(.:format) dashboard#index
|
||||
# dashboard_issues GET /dashboard/issues(.:format) dashboard#issues
|
||||
# dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests
|
||||
# root / dashboard#index
|
||||
describe DashboardController, "routing" do
|
||||
it "to #index" do
|
||||
get("/dashboard").should route_to('dashboard#index')
|
||||
get("/").should route_to('dashboard#index')
|
||||
end
|
||||
|
||||
it "to #issues" do
|
||||
get("/dashboard/issues").should route_to('dashboard#issues')
|
||||
end
|
||||
|
||||
it "to #merge_requests" do
|
||||
get("/dashboard/merge_requests").should route_to('dashboard#merge_requests')
|
||||
end
|
||||
end
|
||||
|
||||
# new_user_session GET /users/sign_in(.:format) devise/sessions#new
|
||||
# user_session POST /users/sign_in(.:format) devise/sessions#create
|
||||
# destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
|
||||
# user_omniauth_authorize /users/auth/:provider(.:format) omniauth_callbacks#passthru
|
||||
# user_omniauth_callback /users/auth/:action/callback(.:format) omniauth_callbacks#(?-mix:(?!))
|
||||
# user_password POST /users/password(.:format) devise/passwords#create
|
||||
# new_user_password GET /users/password/new(.:format) devise/passwords#new
|
||||
# edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
|
||||
# PUT /users/password(.:format) devise/passwords#update
|
||||
describe "Authentication", "routing" do
|
||||
# pending
|
||||
end
|
|
@ -5,42 +5,16 @@ module GitoliteStub
|
|||
end
|
||||
|
||||
def stub_gitolite_admin
|
||||
gitolite_repo = mock(
|
||||
clean_permissions: true,
|
||||
add_permission: true
|
||||
)
|
||||
|
||||
gitolite_config = mock(
|
||||
add_repo: true,
|
||||
get_repo: gitolite_repo,
|
||||
has_repo?: true
|
||||
)
|
||||
|
||||
gitolite_admin = double(
|
||||
'Gitolite::GitoliteAdmin',
|
||||
config: gitolite_config,
|
||||
save: true,
|
||||
)
|
||||
gitolite_admin = double('Gitolite::GitoliteAdmin')
|
||||
gitolite_admin.as_null_object
|
||||
|
||||
Gitolite::GitoliteAdmin.stub(new: gitolite_admin)
|
||||
|
||||
end
|
||||
|
||||
def stub_gitlab_gitolite
|
||||
gitolite_config = double('Gitlab::GitoliteConfig')
|
||||
gitolite_config.stub(
|
||||
apply: ->() { yield(self) },
|
||||
write_key: true,
|
||||
rm_key: true,
|
||||
update_projects: true,
|
||||
update_project: true,
|
||||
update_project!: true,
|
||||
destroy_project: true,
|
||||
destroy_project!: true,
|
||||
admin_all_repo: true,
|
||||
admin_all_repo!: true,
|
||||
|
||||
)
|
||||
gitolite_config.stub(apply: ->() { yield(self) })
|
||||
gitolite_config.as_null_object
|
||||
|
||||
Gitlab::GitoliteConfig.stub(new: gitolite_config)
|
||||
end
|
||||
|
|
|
@ -73,11 +73,7 @@ module Shoulda::Matchers::ActiveModel
|
|||
class EnsureLengthOfMatcher
|
||||
# Shortcut for is_at_least and is_at_most
|
||||
def is_within(range)
|
||||
if range.exclude_end?
|
||||
is_at_least(range.first) && is_at_most(range.last - 1)
|
||||
else
|
||||
is_at_least(range.first) && is_at_most(range.last)
|
||||
end
|
||||
is_at_least(range.min) && is_at_most(range.max)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue