Ember Upgrade: 1.0

This commit is contained in:
Robin Ward
2013-09-16 14:08:55 -04:00
parent 01075c5e7a
commit be0ce08cc2
110 changed files with 19597 additions and 8477 deletions

View File

@@ -14,13 +14,13 @@ test("avatarTemplate", function() {
avatarSelector.get("gravatar_template"),
"we are using gravatar by default");
avatarSelectorController.useUploadedAvatar();
avatarSelectorController.send('useUploadedAvatar');
equal(avatarSelectorController.get("avatarTemplate"),
avatarSelector.get("uploaded_avatar_template"),
"calling useUploadedAvatar switches to using the uploaded avatar");
avatarSelectorController.useGravatar();
avatarSelectorController.send('useGravatar');
equal(avatarSelectorController.get("avatarTemplate"),
avatarSelector.get("gravatar_template"),

View File

@@ -18,16 +18,16 @@ test("editingMode", function() {
ok(!topicController.get('editingTopic'), "we are not editing by default");
topicController.set('model.details.can_edit', false);
topicController.editTopic();
topicController.send('editTopic');
ok(!topicController.get('editingTopic'), "calling editTopic doesn't enable editing unless the user can edit");
topicController.set('model.details.can_edit', true);
topicController.editTopic();
topicController.send('editTopic');
ok(topicController.get('editingTopic'), "calling editTopic enables editing if the user can edit");
equal(topicController.get('newTitle'), topic.get('title'));
equal(topicController.get('newCategoryId'), topic.get('category_id'));
topicController.cancelEditingTopic();
topicController.send('cancelEditingTopic');
ok(!topicController.get('editingTopic'), "cancelling edit mode reverts the property value");
});
@@ -43,12 +43,12 @@ test("toggledSelectedPost", function() {
equal(tc.get('selectedPostsCount'), 0, "there is a selected post count of 0");
ok(!tc.postSelected(post), "the post is not selected by default");
tc.toggledSelectedPost(post);
tc.send('toggledSelectedPost', post);
present(tc.get('selectedPosts'), "there is a selectedPosts collection");
equal(tc.get('selectedPostsCount'), 1, "there is a selected post now");
ok(tc.postSelected(post), "the post is now selected");
tc.toggledSelectedPost(post);
tc.send('toggledSelectedPost', post);
ok(!tc.postSelected(post), "the post is no longer selected");
});
@@ -61,10 +61,10 @@ test("selectAll", function() {
postStream.appendPost(post);
ok(!tc.postSelected(post), "the post is not selected by default");
tc.selectAll();
tc.send('selectAll');
ok(tc.postSelected(post), "the post is now selected");
ok(tc.get('allPostsSelected'), "all posts are selected");
tc.deselectAll();
tc.send('deselectAll');
ok(!tc.postSelected(post), "the post is deselected again");
ok(!tc.get('allPostsSelected'), "all posts are not selected");
@@ -80,10 +80,10 @@ test("Automating setting of allPostsSelected", function() {
postStream.appendPost(post);
ok(!tc.get('allPostsSelected'), "all posts are not selected by default");
tc.toggledSelectedPost(post);
tc.send('toggledSelectedPost', post);
ok(tc.get('allPostsSelected'), "all posts are selected if we select the only post");
tc.toggledSelectedPost(post);
tc.send('toggledSelectedPost', post);
ok(!tc.get('allPostsSelected'), "the posts are no longer automatically selected");
});
@@ -96,20 +96,20 @@ test("Select Replies when present", function() {
postStream = tc.get('postStream');
ok(!tc.postSelected(p3), "replies are not selected by default");
tc.toggledSelectedPostReplies(p1);
tc.send('toggledSelectedPostReplies', p1);
ok(tc.postSelected(p1), "it selects the post");
ok(!tc.postSelected(p2), "it doesn't select a post that's not a reply");
ok(tc.postSelected(p3), "it selects a post that is a reply");
equal(tc.get('selectedPostsCount'), 2, "it has a selected posts count of two");
// If we deselected the post whose replies are selected...
tc.toggledSelectedPost(p1);
tc.send('toggledSelectedPost', p1);
ok(!tc.postSelected(p1), "it deselects the post");
ok(!tc.postSelected(p3), "it deselects the replies too");
// If we deselect a reply, it should deselect the parent's replies selected attribute. Weird but what else would make sense?
tc.toggledSelectedPostReplies(p1);
tc.toggledSelectedPost(p3);
tc.send('toggledSelectedPostReplies', p1);
tc.send('toggledSelectedPost', p3);
ok(tc.postSelected(p1), "the post stays selected");
ok(!tc.postSelected(p3), "it deselects the replies too");

View File

@@ -184,7 +184,5 @@ var jsHintOpts = {
<%= jshint("#{Rails.root}/app/assets/javascripts/**/*.js",
"/app/assets/javascripts/",
[/external\//,
/external_development\//,
/external_production\//,
/defer\//,
/locales\//]) %>

View File

@@ -9,10 +9,10 @@
//= require ../../app/assets/javascripts/discourse/components/probes.js
// Externals we need to load first
//= require ../../app/assets/javascripts/external_development/jquery-2.0.3.js
//= require ../../app/assets/javascripts/external/jquery.ui.widget.js
//= require ../../app/assets/javascripts/external/handlebars.js
//= require ../../app/assets/javascripts/external_development/ember.js
//= require development/jquery-2.0.3.js
//= require jquery.ui.widget.js
//= require handlebars.js
//= require development/ember.js
//= require ../../app/assets/javascripts/locales/i18n
//= require ../../app/assets/javascripts/discourse/helpers/i18n_helpers
@@ -21,8 +21,36 @@
// Pagedown customizations
//= require ../../app/assets/javascripts/pagedown_custom.js
// The rest of the externals
//= require_tree ../../app/assets/javascripts/external
// The rest of the vendored JS
//= require LAB.js
//= require Markdown.Converter.js
//= require Markdown.Editor.js
//= require Markdown.Sanitizer.js
//= require better_markdown.js
//= require bootbox.js
//= require bootstrap-alert.js
//= require bootstrap-button.js
//= require bootstrap-dropdown.js
//= require bootstrap-modal.js
//= require bootstrap-transition.js
//= require browser-update.js
//= require chosen.jquery.js
//= require ember-renderspeed.js
//= require favcount.js
//= require jquery.ba-replacetext.js
//= require jquery.ba-resize.min.js
//= require jquery.color.js
//= require jquery.cookie.js
//= require jquery.fileupload.js
//= require jquery.iframe-transport.js
//= require jquery.putcursoratend.js
//= require jquery.tagsinput.js
//= require lodash.js
//= require md5.js
//= require modernizr.custom.95264.js
//= require mousetrap.js
//= require rsvp.js
//= require show-html.js
// Stuff we need to load first
//= require main_include