Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Milan
diaspora
Commits
0241d9c7
Commit
0241d9c7
authored
Mar 10, 2014
by
Steffen van Bergerem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use fixture
parent
6fc6474e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
40 deletions
+24
-40
app/assets/javascripts/app/views/publisher_view.js
app/assets/javascripts/app/views/publisher_view.js
+1
-1
spec/controllers/jasmine_fixtures/status_messages_spec.rb
spec/controllers/jasmine_fixtures/status_messages_spec.rb
+19
-0
spec/javascripts/app/views/aspects_dropdown_view_spec.js
spec/javascripts/app/views/aspects_dropdown_view_spec.js
+4
-39
No files found.
app/assets/javascripts/app/views/publisher_view.js
View file @
0241d9c7
...
...
@@ -261,7 +261,7 @@ app.views.Publisher = Backbone.View.extend({
keyDown
:
function
(
evt
)
{
if
(
evt
.
keyCode
==
13
&&
evt
.
ctrlKey
)
{
this
.
el_submit
.
click
();
this
.
$
(
"
form
"
).
submit
();
this
.
open
();
return
false
;
}
...
...
spec/controllers/jasmine_fixtures/status_messages_spec.rb
0 → 100644
View file @
0241d9c7
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require
'spec_helper'
describe
StatusMessagesController
do
describe
'#bookmarklet'
do
before
do
sign_in
:user
,
bob
end
it
"generates a jasmine fixture"
,
:fixture
=>
true
do
get
:bookmarklet
save_fixture
(
html_for
(
"body"
),
"bookmarklet"
)
end
end
end
spec/javascripts/app/views/aspects_dropdown_view_spec.js
View file @
0241d9c7
describe
(
"
app.views.AspectsDropdown
"
,
function
(){
beforeEach
(
function
()
{
spec
.
content
().
html
(
'
<div class="btn-group aspect_dropdown">
'
+
'
<button class="btn dropdown-toggle" data-toggle="dropdown">
'
+
'
<span class="text">
'
+
Diaspora
.
I18n
.
t
(
'
all_aspects
'
)
+
'
</span>
'
+
'
<span class="caret"></span>
'
+
'
</button>
'
+
'
<ul class="dropdown-menu">
'
+
'
<li class="public radio" data-aspect_id="public">
'
+
'
<a>
'
+
'
<span class="status_indicator"><i class="icon-ok"></i></span>
'
+
'
<span class="text">
'
+
Diaspora
.
I18n
.
t
(
'
public
'
)
+
'
</span>
'
+
'
</a>
'
+
'
</li>
'
+
'
<li class="all_aspects radio" data-aspect_id="all_aspects">
'
+
'
<a>
'
+
'
<span class="status_indicator"><i class="icon-ok"></i></span>
'
+
'
<span class="text">
'
+
Diaspora
.
I18n
.
t
(
'
all_aspects
'
)
+
'
</span>
'
+
'
</a>
'
+
'
</li>
'
+
'
<li class="divider"></li>
'
+
'
<li class="aspect_selector" data-aspect_id="10">
'
+
'
<a>
'
+
'
<span class="status_indicator"><i class="icon-ok"></i></span>
'
+
'
<span class="text">Aspect 10</span>
'
+
'
</a>
'
+
'
</li>
'
+
'
<li class="aspect_selector" data-aspect_id="12">
'
+
'
<a>
'
+
'
<span class="status_indicator"><i class="icon-ok"></i></span>
'
+
'
<span class="text">Aspect 12</span>
'
+
'
</a>
'
+
'
</li>
'
+
'
</ul>
'
+
'
</div>
'
);
this
.
view
=
new
app
.
views
.
AspectsDropdown
({
el
:
spec
.
content
()});
spec
.
loadFixture
(
"
bookmarklet
"
);
this
.
view
=
new
app
.
views
.
AspectsDropdown
({
el
:
$
(
'
.aspect_dropdown
'
)});
});
context
(
'
_toggleCheckbox
'
,
function
()
{
...
...
@@ -96,7 +61,7 @@ describe("app.views.AspectsDropdown", function(){
});
it
(
'
select aspects in the dropdown by a given list of ids
'
,
function
()
{
this
.
ids
=
[
12
,
'
public
'
];
this
.
ids
=
[
this
.
view
.
$
(
'
li.aspect_selector:eq(1)
'
).
data
(
'
aspect_id
'
)
,
'
public
'
];
this
.
view
.
_selectAspects
(
this
.
ids
);
expect
(
this
.
view
.
$
(
'
li.all_aspects.radio
'
).
hasClass
(
'
selected
'
)).
toBeFalsy
();
expect
(
this
.
view
.
$
(
'
li.public.radio
'
).
hasClass
(
'
selected
'
)).
toBeTruthy
();
...
...
@@ -124,7 +89,7 @@ describe("app.views.AspectsDropdown", function(){
it
(
'
shows the name of the selected aspect ( == 1 )
'
,
function
()
{
this
.
view
.
$
(
'
li.aspect_selector:eq(1)
'
).
addClass
(
'
selected
'
);
this
.
view
.
_updateButton
(
'
inAspectClass
'
);
expect
(
this
.
view
.
$
(
'
.btn.dropdown-toggle > .text
'
).
text
()).
toContain
(
"
Aspect 12
"
);
expect
(
this
.
view
.
$
(
'
.btn.dropdown-toggle > .text
'
).
text
()).
toContain
(
this
.
view
.
$
(
'
li.aspect_selector:eq(1) .text
'
).
text
()
);
});
it
(
'
shows the number of selected aspects ( > 1)
'
,
function
()
{
...
...
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