Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
df583bf1
Commit
df583bf1
authored
Dec 31, 2011
by
miks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for deploy_keys updated
parent
b8b6515f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
50 deletions
+6
-50
spec/factories.rb
spec/factories.rb
+0
-5
spec/models/deploy_key_spec.rb
spec/models/deploy_key_spec.rb
+0
-29
spec/models/key_spec.rb
spec/models/key_spec.rb
+1
-1
spec/monkeypatch.rb
spec/monkeypatch.rb
+0
-10
spec/requests/projects_deploy_keys_spec.rb
spec/requests/projects_deploy_keys_spec.rb
+5
-5
No files found.
spec/factories.rb
View file @
df583bf1
...
@@ -56,11 +56,6 @@ Factory.add(:key, Key) do |obj|
...
@@ -56,11 +56,6 @@ Factory.add(:key, Key) do |obj|
obj
.
key
=
File
.
read
(
File
.
join
(
Rails
.
root
,
"db"
,
"pkey.example"
))
obj
.
key
=
File
.
read
(
File
.
join
(
Rails
.
root
,
"db"
,
"pkey.example"
))
end
end
Factory
.
add
(
:deploy_key
,
DeployKey
)
do
|
obj
|
obj
.
title
=
"Example key"
obj
.
key
=
File
.
read
(
File
.
join
(
Rails
.
root
,
"db"
,
"pkey.example"
))
end
Factory
.
add
(
:web_hook
,
WebHook
)
do
|
obj
|
Factory
.
add
(
:web_hook
,
WebHook
)
do
|
obj
|
obj
.
url
=
Faker
::
Internet
.
url
obj
.
url
=
Faker
::
Internet
.
url
end
end
spec/models/deploy_key_spec.rb
deleted
100644 → 0
View file @
b8b6515f
require
'spec_helper'
describe
DeployKey
do
describe
"Associations"
do
it
{
should
belong_to
(
:project
)
}
end
describe
"Validation"
do
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
validate_presence_of
(
:key
)
}
end
it
{
Factory
.
create
(
:deploy_key
,
:project
=>
Factory
(
:project
)).
should
be_valid
}
end
# == Schema Information
#
# Table name: deploy_keys
#
# id :integer not null, primary key
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# key :text
# title :string(255)
# identifier :string(255)
#
spec/models/key_spec.rb
View file @
df583bf1
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Key
do
describe
Key
do
describe
"Associations"
do
describe
"Associations"
do
it
{
should
belong_to
(
:user
)
}
it
{
should
belong_to
(
:user
)
or
belong_to
(
:project
)
}
end
end
describe
"Validation"
do
describe
"Validation"
do
...
...
spec/monkeypatch.rb
View file @
df583bf1
...
@@ -24,16 +24,6 @@ class Key
...
@@ -24,16 +24,6 @@ class Key
end
end
end
end
class
DeployKey
def
update_repository
true
end
def
repository_delete_key
true
end
end
class
UsersProject
class
UsersProject
def
update_repository
def
update_repository
true
true
...
...
spec/requests/projects_deploy_keys_spec.rb
View file @
df583bf1
...
@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do
...
@@ -10,7 +10,7 @@ describe "Projects", "DeployKeys" do
describe
"GET /keys"
do
describe
"GET /keys"
do
before
do
before
do
@key
=
Factory
:
deploy_
key
,
:project
=>
project
@key
=
Factory
:key
,
:project
=>
project
visit
project_deploy_keys_path
(
project
)
visit
project_deploy_keys_path
(
project
)
end
end
...
@@ -41,11 +41,11 @@ describe "Projects", "DeployKeys" do
...
@@ -41,11 +41,11 @@ describe "Projects", "DeployKeys" do
describe
"fill in"
do
describe
"fill in"
do
before
do
before
do
fill_in
"
deploy_
key_title"
,
:with
=>
"laptop"
fill_in
"key_title"
,
:with
=>
"laptop"
fill_in
"
deploy_
key_key"
,
:with
=>
"publickey234="
fill_in
"key_key"
,
:with
=>
"publickey234="
end
end
it
{
expect
{
click_button
"Save"
}.
to
change
{
Deploy
Key
.
count
}.
by
(
1
)
}
it
{
expect
{
click_button
"Save"
}.
to
change
{
Key
.
count
}.
by
(
1
)
}
it
"should add new key to table"
do
it
"should add new key to table"
do
click_button
"Save"
click_button
"Save"
...
@@ -58,7 +58,7 @@ describe "Projects", "DeployKeys" do
...
@@ -58,7 +58,7 @@ describe "Projects", "DeployKeys" do
describe
"Show page"
do
describe
"Show page"
do
before
do
before
do
@key
=
Factory
:
deploy_
key
,
:project
=>
project
@key
=
Factory
:key
,
:project
=>
project
visit
project_deploy_key_path
(
project
,
@key
)
visit
project_deploy_key_path
(
project
,
@key
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment