No more fake text in the publisher
This commit is contained in:
parent
a04f32adce
commit
c4b6b9534c
12 changed files with 43 additions and 91 deletions
|
|
@ -6,18 +6,17 @@ app.views.PublisherMention = app.views.SearchBase.extend({
|
||||||
mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; },
|
mentionSyntaxTemplate: function(person) { return "@{" + person.handle + "}"; },
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
"keydown #status_message_fake_text": "onInputBoxKeyDown",
|
"keydown #status_message_text": "onInputBoxKeyDown",
|
||||||
"input #status_message_fake_text": "onInputBoxInput",
|
"input #status_message_text": "onInputBoxInput",
|
||||||
"click #status_message_fake_text": "onInputBoxClick",
|
"click #status_message_text": "onInputBoxClick",
|
||||||
"blur #status_message_fake_text": "onInputBoxBlur"
|
"blur #status_message_text": "onInputBoxBlur"
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.mentionedPeople = [];
|
this.mentionedPeople = [];
|
||||||
|
|
||||||
// contains the 'fake text' displayed to the user
|
// has a data-messageText attribute with the original text
|
||||||
// also has a data-messageText attribute with the original text
|
this.inputBox = this.$("#status_message_text");
|
||||||
this.inputBox = this.$("#status_message_fake_text");
|
|
||||||
this.typeaheadInput = this.$(".typeahead-mention-box");
|
this.typeaheadInput = this.$(".typeahead-mention-box");
|
||||||
this.bindTypeaheadEvents();
|
this.bindTypeaheadEvents();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
el : "#publisher",
|
el : "#publisher",
|
||||||
|
|
||||||
events : {
|
events : {
|
||||||
"keydown #status_message_fake_text" : "keyDown",
|
"keydown #status_message_text": "keyDown",
|
||||||
"focus textarea" : "open",
|
"focus textarea" : "open",
|
||||||
"submit form" : "createStatusMessage",
|
"submit form" : "createStatusMessage",
|
||||||
"click #submit" : "createStatusMessage",
|
"click #submit" : "createStatusMessage",
|
||||||
"textchange #status_message_fake_text": "handleTextchange",
|
"textchange #status_message_text": "handleTextchange",
|
||||||
"click #locator" : "showLocation",
|
"click #locator" : "showLocation",
|
||||||
"click #poll_creator" : "togglePollCreator",
|
"click #poll_creator" : "togglePollCreator",
|
||||||
"click #hide_location" : "destroyLocation",
|
"click #hide_location" : "destroyLocation",
|
||||||
|
|
@ -35,8 +35,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
this.disabled = false;
|
this.disabled = false;
|
||||||
|
|
||||||
// init shortcut references to the various elements
|
// init shortcut references to the various elements
|
||||||
this.inputEl = this.$("#status_message_fake_text");
|
this.inputEl = this.$("#status_message_text");
|
||||||
this.hiddenInputEl = this.$("#status_message_text");
|
|
||||||
this.wrapperEl = this.$("#publisher_textarea_wrapper");
|
this.wrapperEl = this.$("#publisher_textarea_wrapper");
|
||||||
this.submitEl = this.$("input[type=submit], button#submit");
|
this.submitEl = this.$("input[type=submit], button#submit");
|
||||||
this.photozoneEl = this.$("#photodropzone");
|
this.photozoneEl = this.$("#photodropzone");
|
||||||
|
|
@ -46,14 +45,6 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
$(window).on("beforeunload", _.bind(this._beforeUnload, this));
|
$(window).on("beforeunload", _.bind(this._beforeUnload, this));
|
||||||
$(window).unload(this.clear.bind(this));
|
$(window).unload(this.clear.bind(this));
|
||||||
|
|
||||||
// sync textarea content
|
|
||||||
if( this.hiddenInputEl.val() === "" ) {
|
|
||||||
this.hiddenInputEl.val( this.inputEl.val() );
|
|
||||||
}
|
|
||||||
if( this.inputEl.val() === "" ) {
|
|
||||||
this.inputEl.val( this.hiddenInputEl.val() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// hide close and preview buttons and manage services link
|
// hide close and preview buttons and manage services link
|
||||||
// in case publisher is standalone
|
// in case publisher is standalone
|
||||||
// (e.g. bookmarklet, mentions popup)
|
// (e.g. bookmarklet, mentions popup)
|
||||||
|
|
@ -175,7 +166,6 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
// inject content into the publisher textarea
|
// inject content into the publisher textarea
|
||||||
setText: function(txt) {
|
setText: function(txt) {
|
||||||
this.inputEl.val(txt);
|
this.inputEl.val(txt);
|
||||||
this.hiddenInputEl.val(txt);
|
|
||||||
this.prefillText = txt;
|
this.prefillText = txt;
|
||||||
|
|
||||||
this.inputEl.trigger("input");
|
this.inputEl.trigger("input");
|
||||||
|
|
@ -381,9 +371,8 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
// remove mentions
|
// remove mentions
|
||||||
this.mention.reset();
|
this.mention.reset();
|
||||||
|
|
||||||
// clear text(s)
|
// clear text
|
||||||
this.inputEl.val("");
|
this.inputEl.val("");
|
||||||
this.hiddenInputEl.val("");
|
|
||||||
this.inputEl.trigger("keyup")
|
this.inputEl.trigger("keyup")
|
||||||
.trigger("keydown");
|
.trigger("keydown");
|
||||||
autosize.update(this.inputEl);
|
autosize.update(this.inputEl);
|
||||||
|
|
@ -421,7 +410,6 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
|
|
||||||
// force textchange plugin to update lastValue
|
// force textchange plugin to update lastValue
|
||||||
this.inputEl.data("lastValue", "");
|
this.inputEl.data("lastValue", "");
|
||||||
this.hiddenInputEl.data("lastValue", "");
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
@ -487,10 +475,8 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
setInputEnabled: function(bool) {
|
setInputEnabled: function(bool) {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
this.inputEl.removeAttr("disabled");
|
this.inputEl.removeAttr("disabled");
|
||||||
this.hiddenInputEl.removeAttr("disabled");
|
|
||||||
} else {
|
} else {
|
||||||
this.inputEl.prop("disabled", true);
|
this.inputEl.prop("disabled", true);
|
||||||
this.hiddenInputEl.prop("disabled", true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -505,7 +491,6 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
|
|
||||||
handleTextchange: function() {
|
handleTextchange: function() {
|
||||||
this.checkSubmitAvailability();
|
this.checkSubmitAvailability();
|
||||||
this.hiddenInputEl.val(this.mention.getTextForSubmit());
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_beforeUnload: function(e) {
|
_beforeUnload: function(e) {
|
||||||
|
|
|
||||||
|
|
@ -21,16 +21,6 @@ module InterimStreamHackinessHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def publisher_hidden_text
|
|
||||||
if params[:prefill].present?
|
|
||||||
params[:prefill]
|
|
||||||
elsif defined?(@stream)
|
|
||||||
@stream.publisher.prefill
|
|
||||||
else
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def from_group(post)
|
def from_group(post)
|
||||||
if defined?(@stream) && params[:controller] == 'multis'
|
if defined?(@stream) && params[:controller] == 'multis'
|
||||||
@stream.post_from_group(post)
|
@stream.post_from_group(post)
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,16 @@
|
||||||
.publisher-textarea-wrapper#publisher_textarea_wrapper
|
.publisher-textarea-wrapper#publisher_textarea_wrapper
|
||||||
.mentions-input-box
|
.mentions-input-box
|
||||||
- if current_user.getting_started?
|
- if current_user.getting_started?
|
||||||
= status.text_area :fake_text, :rows => 2, :value => h(publisher_formatted_text),
|
= status.text_area :text, :rows => 2, :value => h(publisher_formatted_text),
|
||||||
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
||||||
"data-title" => popover_with_close_html("1. " + t("shared.public_explain.share")),
|
"data-title" => popover_with_close_html("1. " + t("shared.public_explain.share")),
|
||||||
"data-content" => t("shared.public_explain.new_user_welcome_message"),
|
"data-content" => t("shared.public_explain.new_user_welcome_message"),
|
||||||
"class" => "form-control"
|
"class" => "form-control"
|
||||||
- else
|
- else
|
||||||
= status.text_area :fake_text, :rows => 2, :value => h(publisher_formatted_text),
|
= status.text_area :text, :rows => 2, :value => h(publisher_formatted_text),
|
||||||
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
:tabindex => 1, :placeholder => "#{t('contacts.index.start_a_conversation')}...",
|
||||||
"class" => "form-control"
|
"class" => "form-control"
|
||||||
%input.typeahead-mention-box.hidden{type: "text"}
|
%input.typeahead-mention-box.hidden{type: "text"}
|
||||||
= status.hidden_field :text, value: h(publisher_hidden_text), class: "clear_on_submit"
|
|
||||||
|
|
||||||
.container-fluid.photodropzone-container#photodropzone_container
|
.container-fluid.photodropzone-container#photodropzone_container
|
||||||
%ul#photodropzone
|
%ul#photodropzone
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ Feature: preview posts in the stream
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I attach "spec/fixtures/button.png" to the publisher
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | Look at this dog |
|
| status_message_text | Look at this dog |
|
||||||
And I preview the post
|
And I preview the post
|
||||||
Then I should see a "img" within ".md-preview .stream-element .photo_attachments"
|
Then I should see a "img" within ".md-preview .stream-element .photo_attachments"
|
||||||
And I should see "Look at this dog" within ".md-preview .stream-element"
|
And I should see "Look at this dog" within ".md-preview .stream-element"
|
||||||
|
|
@ -63,7 +63,7 @@ Feature: preview posts in the stream
|
||||||
Then I should see "Samuel Beckett"
|
Then I should see "Samuel Beckett"
|
||||||
When I expand the publisher
|
When I expand the publisher
|
||||||
And I fill in the following:
|
And I fill in the following:
|
||||||
| status_message_fake_text | This preview rocks |
|
| status_message_text | This preview rocks |
|
||||||
And I preview the post
|
And I preview the post
|
||||||
Then I should see "This preview rocks" in the preview
|
Then I should see "This preview rocks" in the preview
|
||||||
And I close the publisher
|
And I close the publisher
|
||||||
|
|
@ -71,10 +71,10 @@ Feature: preview posts in the stream
|
||||||
Scenario: preview a post with the poll
|
Scenario: preview a post with the poll
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
And I click on selector "#poll_creator"
|
And I click on selector "#poll_creator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| poll_question | What kind of yogurt do you like? |
|
| poll_question | What kind of yogurt do you like? |
|
||||||
And I fill in the following for the options:
|
And I fill in the following for the options:
|
||||||
| normal |
|
| normal |
|
||||||
|
|
@ -87,11 +87,11 @@ Feature: preview posts in the stream
|
||||||
Scenario: preview a post with location
|
Scenario: preview a post with location
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
And I allow geolocation
|
And I allow geolocation
|
||||||
And I click on selector "#locator"
|
And I click on selector "#locator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| location_address | Some cool place |
|
| location_address | Some cool place |
|
||||||
And I preview the post
|
And I preview the post
|
||||||
Then I should see a ".near-from" within ".md-preview .stream-element"
|
Then I should see a ".near-from" within ".md-preview .stream-element"
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ Feature: posting with a poll
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I click on selector "#poll_creator"
|
And I click on selector "#poll_creator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| poll_question | What kind of yogurt do you like? |
|
| poll_question | What kind of yogurt do you like? |
|
||||||
And I fill in the following for the options:
|
And I fill in the following for the options:
|
||||||
| normal |
|
| normal |
|
||||||
|
|
@ -53,7 +53,7 @@ Feature: posting with a poll
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I click on selector "#poll_creator"
|
And I click on selector "#poll_creator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| poll_question | What kind of yogurt do you like? |
|
| poll_question | What kind of yogurt do you like? |
|
||||||
And I fill in the following for the options:
|
And I fill in the following for the options:
|
||||||
| normal |
|
| normal |
|
||||||
|
|
@ -70,7 +70,7 @@ Feature: posting with a poll
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I click on selector "#poll_creator"
|
And I click on selector "#poll_creator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| poll_question | What kind of yogurt do you like? |
|
| poll_question | What kind of yogurt do you like? |
|
||||||
And I fill in the following for the options:
|
And I fill in the following for the options:
|
||||||
| normal |
|
| normal |
|
||||||
|
|
@ -83,7 +83,7 @@ Feature: posting with a poll
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I click on selector "#poll_creator"
|
And I click on selector "#poll_creator"
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | I am eating yogurt |
|
| status_message_text | I am eating yogurt |
|
||||||
| poll_question | What kind of yogurt do you like? |
|
| poll_question | What kind of yogurt do you like? |
|
||||||
And I fill in the following for the options:
|
And I fill in the following for the options:
|
||||||
| normal |
|
| normal |
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Feature: posting from the mobile main page
|
||||||
|
|
||||||
Scenario: post and delete some text
|
Scenario: post and delete some text
|
||||||
Given I visit the mobile publisher page
|
Given I visit the mobile publisher page
|
||||||
And I append "I am eating yogurt" to the mobile publisher
|
And I append "I am eating yogurt" to the publisher
|
||||||
And I select "Unicorns" from "aspect_ids_"
|
And I select "Unicorns" from "aspect_ids_"
|
||||||
And I press "Share"
|
And I press "Share"
|
||||||
When I go to the stream page
|
When I go to the stream page
|
||||||
|
|
@ -52,7 +52,7 @@ Feature: posting from the mobile main page
|
||||||
|
|
||||||
Scenario: back out of uploading a picture when another has been attached
|
Scenario: back out of uploading a picture when another has been attached
|
||||||
Given I visit the mobile publisher page
|
Given I visit the mobile publisher page
|
||||||
And I append "I am eating yogurt" to the mobile publisher
|
And I append "I am eating yogurt" to the publisher
|
||||||
And I attach the file "spec/fixtures/button.gif" to hidden "qqfile" within "#file-upload-publisher"
|
And I attach the file "spec/fixtures/button.gif" to hidden "qqfile" within "#file-upload-publisher"
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload-publisher"
|
And I attach the file "spec/fixtures/button.png" to hidden "qqfile" within "#file-upload-publisher"
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ When /^I press the "([^\"]*)" key somewhere$/ do |key|
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I press the "([^\"]*)" key in the publisher$/ do |key|
|
When /^I press the "([^\"]*)" key in the publisher$/ do |key|
|
||||||
find("#status_message_fake_text").native.send_key(key)
|
find("#status_message_text").native.send_key(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^post (\d+) should be highlighted$/ do |position|
|
Then /^post (\d+) should be highlighted$/ do |position|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ Then /^I should not be able to submit the publisher$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see "([^"]*)" in the publisher$/ do |text|
|
Then /^I should see "([^"]*)" in the publisher$/ do |text|
|
||||||
expect(page).to have_field("status_message[fake_text]", with: text)
|
expect(page).to have_field("status_message[text]", with: text)
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^I have a limited post with text "([^\"]*)" in the aspect "([^"]*)"$/ do |text, aspect_name|
|
Given /^I have a limited post with text "([^\"]*)" in the aspect "([^"]*)"$/ do |text, aspect_name|
|
||||||
|
|
@ -118,10 +118,6 @@ When /^I append "([^"]*)" to the publisher$/ do |text|
|
||||||
append_to_publisher(text)
|
append_to_publisher(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I append "([^"]*)" to the mobile publisher$/ do |text|
|
|
||||||
append_to_publisher(text, '#status_message_text')
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I attach "([^"]*)" to the publisher$/ do |path|
|
When /^I attach "([^"]*)" to the publisher$/ do |path|
|
||||||
upload_file_with_publisher(path)
|
upload_file_with_publisher(path)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,12 @@
|
||||||
module PublishingCukeHelpers
|
module PublishingCukeHelpers
|
||||||
def write_in_publisher(txt)
|
def write_in_publisher(txt)
|
||||||
fill_in 'status_message_fake_text', with: txt
|
fill_in "status_message_text", with: txt
|
||||||
end
|
end
|
||||||
|
|
||||||
def append_to_publisher(txt, input_selector='#status_message_fake_text')
|
def append_to_publisher(txt)
|
||||||
status_message_text = find("#status_message_text", visible: false).value
|
status_message_text = find("#status_message_text").value
|
||||||
find(input_selector).native.send_key(" #{txt}")
|
find("#status_message_text").native.send_key(" #{txt}")
|
||||||
|
expect(page).to have_field("status_message[text]", with: "#{status_message_text} #{txt}")
|
||||||
# make sure the other text field got the new contents
|
|
||||||
if input_selector == "#status_message_fake_text"
|
|
||||||
begin
|
|
||||||
expect(page).to have_selector("#status_message_text[value='#{status_message_text} #{txt}']", visible: false)
|
|
||||||
rescue RSpec::Expectations::ExpectationNotMetError
|
|
||||||
puts "Value was instead: #{find('#status_message_text', visible: false).value.inspect}"
|
|
||||||
raise
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_file_with_publisher(path)
|
def upload_file_with_publisher(path)
|
||||||
|
|
@ -33,7 +24,7 @@ module PublishingCukeHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def submit_publisher
|
def submit_publisher
|
||||||
txt = find("#publisher #status_message_fake_text").value
|
txt = find("#publisher #status_message_text").value
|
||||||
find("#publisher .btn-primary").click
|
find("#publisher .btn-primary").click
|
||||||
# wait for the content to appear
|
# wait for the content to appear
|
||||||
expect(find("#main_stream")).to have_content(txt)
|
expect(find("#main_stream")).to have_content(txt)
|
||||||
|
|
@ -45,7 +36,7 @@ module PublishingCukeHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def click_publisher
|
def click_publisher
|
||||||
find("#status_message_fake_text").click
|
find("#status_message_text").click
|
||||||
expect(find("#publisher")).to have_css(".publisher-textarea-wrapper.active")
|
expect(find("#publisher")).to have_css(".publisher-textarea-wrapper.active")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,23 +29,18 @@ describe("app.views.Bookmarklet", function() {
|
||||||
|
|
||||||
it("prefills the publisher", function() {
|
it("prefills the publisher", function() {
|
||||||
init_bookmarklet(test_data);
|
init_bookmarklet(test_data);
|
||||||
|
|
||||||
expect($.trim(app.publisher.inputEl.val())).not.toEqual("");
|
expect($.trim(app.publisher.inputEl.val())).not.toEqual("");
|
||||||
expect($.trim(app.publisher.hiddenInputEl.val())).not.toEqual("");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles dirty input well", function() {
|
it("handles dirty input well", function() {
|
||||||
init_bookmarklet(evil_test_data);
|
init_bookmarklet(evil_test_data);
|
||||||
|
|
||||||
expect($.trim(app.publisher.inputEl.val())).not.toEqual("");
|
expect($.trim(app.publisher.inputEl.val())).not.toEqual("");
|
||||||
expect($.trim(app.publisher.hiddenInputEl.val())).not.toEqual("");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows changing a prefilled publisher", function() {
|
it("allows changing a prefilled publisher", function() {
|
||||||
init_bookmarklet(test_data);
|
init_bookmarklet(test_data);
|
||||||
app.publisher.setText(app.publisher.inputEl.val()+"A");
|
app.publisher.setText(app.publisher.inputEl.val()+"A");
|
||||||
|
expect(app.publisher.inputEl.val()).toMatch(/.+A$/);
|
||||||
expect(app.publisher.hiddenInputEl.val()).toMatch(/.+A$/);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps the publisher disabled after successful post creation", function() {
|
it("keeps the publisher disabled after successful post creation", function() {
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ describe("app.views.Publisher", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("resets the element's height", function() {
|
it("resets the element's height", function() {
|
||||||
$(this.view.el).find("#status_message_fake_text").height(100);
|
$(this.view.el).find("#status_message_text").height(100);
|
||||||
this.view.close($.Event());
|
this.view.close($.Event());
|
||||||
expect($(this.view.el).find("#status_message_fake_text").attr("style")).not.toContain("height");
|
expect($(this.view.el).find("#status_message_text").attr("style")).not.toContain("height");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("calls autosize.update", function() {
|
it("calls autosize.update", function() {
|
||||||
|
|
@ -235,9 +235,7 @@ describe("app.views.Publisher", function() {
|
||||||
describe('#setText', function() {
|
describe('#setText', function() {
|
||||||
it("sets the content text", function() {
|
it("sets the content text", function() {
|
||||||
this.view.setText("FOO bar");
|
this.view.setText("FOO bar");
|
||||||
|
|
||||||
expect(this.view.inputEl.val()).toEqual("FOO bar");
|
expect(this.view.inputEl.val()).toEqual("FOO bar");
|
||||||
expect(this.view.hiddenInputEl.val()).toEqual("FOO bar");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -248,7 +246,6 @@ describe("app.views.Publisher", function() {
|
||||||
|
|
||||||
expect(this.view.disabled).toBeTruthy();
|
expect(this.view.disabled).toBeTruthy();
|
||||||
expect(this.view.inputEl.prop("disabled")).toBeTruthy();
|
expect(this.view.inputEl.prop("disabled")).toBeTruthy();
|
||||||
expect(this.view.hiddenInputEl.prop("disabled")).toBeTruthy();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("disables submitting", function() {
|
it("disables submitting", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue