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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
520c9371
Commit
520c9371
authored
Mar 17, 2018
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration test added
parent
d23337fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
spec/features/snippets/embedded_snippet_spec.rb
spec/features/snippets/embedded_snippet_spec.rb
+30
-0
No files found.
spec/features/snippets/embedded_snippet_spec.rb
0 → 100644
View file @
520c9371
require
'spec_helper'
describe
'Embedded Snippets'
do
include
RSpec
::
Rails
::
RequestExampleGroup
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:snippet
)
{
create
(
:personal_snippet
,
:public
,
file_name:
'popen.rb'
,
content:
content
)
}
let
(
:content
)
{
project
.
repository
.
blob_at
(
'master'
,
'files/ruby/popen.rb'
).
data
}
after
do
FileUtils
.
rm_f
([
File
.
join
(
File
.
dirname
(
__FILE__
),
'embedded_snippet.html'
),
File
.
join
(
File
.
dirname
(
__FILE__
),
'snippet.js'
)])
end
it
'loads snippet'
,
:js
do
get
"
#{
snippet_path
(
snippet
)
}
.js"
File
.
write
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'snippet.js'
),
response
.
body
)
script_tag
=
"<html><body><script src=
\"
snippet.js
\"
></script></body></html>"
File
.
write
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'embedded_snippet.html'
),
script_tag
)
Capybara
.
app
=
Rack
::
File
.
new
File
.
dirname
__FILE__
visit
(
'embedded_snippet.html'
)
expect
(
page
).
to
have_content
(
"popen.rb"
)
expect
(
page
).
to
have_content
(
"require 'fileutils'"
)
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