mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename "User Expansion" to the much clearer "User Card"
This commit is contained in:
@@ -32,7 +32,7 @@ export default Em.Component.extend({
|
|||||||
if (c.get('usersExpanded')) {
|
if (c.get('usersExpanded')) {
|
||||||
var postUrl;
|
var postUrl;
|
||||||
c.get('users').forEach(function(u) {
|
c.get('users').forEach(function(u) {
|
||||||
iconsHtml += "<a href=\"" + Discourse.getURL("/users/") + u.get('username_lower') + "\" data-user-expand=\"" + u.get('username_lower') + "\">";
|
iconsHtml += "<a href=\"" + Discourse.getURL("/users/") + u.get('username_lower') + "\" data-user-card=\"" + u.get('username_lower') + "\">";
|
||||||
if (u.post_url) {
|
if (u.post_url) {
|
||||||
postUrl = postUrl || u.post_url;
|
postUrl = postUrl || u.post_url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
attributeBindings: ['href'],
|
attributeBindings: ['href'],
|
||||||
classNames: ['trigger-expansion'],
|
classNames: ['trigger-user-card'],
|
||||||
href: Em.computed.alias('post.usernameUrl'),
|
href: Em.computed.alias('post.usernameUrl'),
|
||||||
|
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
var PosterNameComponent = Em.Component.extend({
|
var PosterNameComponent = Em.Component.extend({
|
||||||
classNames: ['names', 'trigger-expansion'],
|
classNames: ['names', 'trigger-user-card'],
|
||||||
displayNameOnPosts: Discourse.computed.setting('display_name_on_posts'),
|
displayNameOnPosts: Discourse.computed.setting('display_name_on_posts'),
|
||||||
|
|
||||||
// sanitize name for comparison
|
// sanitize name for comparison
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default {
|
|||||||
$currentTarget.data('ember-action') ||
|
$currentTarget.data('ember-action') ||
|
||||||
$currentTarget.data('auto-route') ||
|
$currentTarget.data('auto-route') ||
|
||||||
$currentTarget.data('share-url') ||
|
$currentTarget.data('share-url') ||
|
||||||
$currentTarget.data('user-expand') ||
|
$currentTarget.data('user-card') ||
|
||||||
$currentTarget.hasClass('mention') ||
|
$currentTarget.hasClass('mention') ||
|
||||||
$currentTarget.hasClass('ember-view') ||
|
$currentTarget.hasClass('ember-view') ||
|
||||||
$currentTarget.hasClass('lightbox') ||
|
$currentTarget.hasClass('lightbox') ||
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var ApplicationRoute = Discourse.Route.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
expandUser: function(user) {
|
expandUser: function(user) {
|
||||||
this.controllerFor('user-expansion').show(user.get('username'), user.get('uploaded_avatar_id'));
|
this.controllerFor('user-card').show(user.get('username'), user.get('uploaded_avatar_id'));
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ Discourse.TopicRoute = Discourse.Route.extend({
|
|||||||
|
|
||||||
// Modals that can pop up within a topic
|
// Modals that can pop up within a topic
|
||||||
expandPostUser: function(post) {
|
expandPostUser: function(post) {
|
||||||
this.controllerFor('user-expansion').show(post.get('username'), post.get('uploaded_avatar_id'));
|
this.controllerFor('user-card').show(post.get('username'), post.get('uploaded_avatar_id'));
|
||||||
},
|
},
|
||||||
|
|
||||||
expandPostUsername: function(username) {
|
expandPostUsername: function(username) {
|
||||||
username = username.replace(/^@/, '');
|
username = username.replace(/^@/, '');
|
||||||
if (!Em.isEmpty(username)) {
|
if (!Em.isEmpty(username)) {
|
||||||
this.controllerFor('user-expansion').show(username);
|
this.controllerFor('user-card').show(username);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ Discourse.TopicRoute = Discourse.Route.extend({
|
|||||||
|
|
||||||
// Clear the search context
|
// Clear the search context
|
||||||
this.controllerFor('search').set('searchContext', null);
|
this.controllerFor('search').set('searchContext', null);
|
||||||
this.controllerFor('user-expansion').set('visible', false);
|
this.controllerFor('user-card').set('visible', false);
|
||||||
|
|
||||||
var topicController = this.controllerFor('topic'),
|
var topicController = this.controllerFor('topic'),
|
||||||
postStream = topicController.get('postStream');
|
postStream = topicController.get('postStream');
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div id='main-outlet' {{bind-attr class=backgroundClass}}>
|
<div id='main-outlet' {{bind-attr class=backgroundClass}}>
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
{{render "user-expansion"}}
|
{{render "user-card"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{render "modal"}}
|
{{render "modal"}}
|
||||||
|
|||||||
@@ -111,15 +111,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group pref-profile-bg">
|
<div class="control-group pref-profile-bg">
|
||||||
<label class="control-label">{{i18n user.change_expansion_background.title}}</label>
|
<label class="control-label">{{i18n user.change_card_background.title}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{image-uploader uploadUrl=imageUploadUrl
|
{{image-uploader uploadUrl=imageUploadUrl
|
||||||
imageUrl=expansion_background
|
imageUrl=card_background
|
||||||
instantDelete="true"
|
instantDelete="true"
|
||||||
type="expansion_background"}}
|
type="card_background"}}
|
||||||
</div>
|
</div>
|
||||||
<div class='instructions'>
|
<div class='instructions'>
|
||||||
{{i18n user.change_expansion_background.instructions}}
|
{{i18n user.change_card_background.instructions}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{#grouped-each model.content}}
|
{{#grouped-each model.content}}
|
||||||
<div {{bind-attr class=":item hidden deleted moderator_action"}}>
|
<div {{bind-attr class=":item hidden deleted moderator_action"}}>
|
||||||
<div class='clearfix info'>
|
<div class='clearfix info'>
|
||||||
<a href="{{unbound userUrl}}" data-user-expand="{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
|
<a href="{{unbound userUrl}}" data-user-card="{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
|
||||||
<span class='time'>{{format-date path="created_at" leaveAgo="true"}}</span>
|
<span class='time'>{{format-date path="created_at" leaveAgo="true"}}</span>
|
||||||
<span class="title">
|
<span class="title">
|
||||||
<a href="{{unbound postUrl}}">{{unbound title}}</a>
|
<a href="{{unbound postUrl}}">{{unbound title}}</a>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
{{i18n "bookmarks.remove"}}
|
{{i18n "bookmarks.remove"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a href="{{unbound userUrl}}" data-user-expand="{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="tiny" extraClasses="actor" ignoreTitle="true"}}</div></a>
|
<a href="{{unbound userUrl}}" data-user-card="{{unbound username}}" class='avatar-link'><div class='avatar-wrapper'>{{avatar this imageSize="tiny" extraClasses="actor" ignoreTitle="true"}}</div></a>
|
||||||
{{#if edit_reason}} — <span class="edit-reason">{{unbound edit_reason}}</span>{{/if}}
|
{{#if edit_reason}} — <span class="edit-reason">{{unbound edit_reason}}</span>{{/if}}
|
||||||
{{/grouped-each}}
|
{{/grouped-each}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import { renderAvatar } from 'discourse/helpers/user-avatar';
|
|||||||
|
|
||||||
export default Ember.View.extend({
|
export default Ember.View.extend({
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
attributeBindings: ['href', 'data-user-expand'],
|
attributeBindings: ['href', 'data-user-card'],
|
||||||
classNameBindings: ['content.extras'],
|
classNameBindings: ['content.extras'],
|
||||||
|
|
||||||
user: Em.computed.alias('content.user'),
|
user: Em.computed.alias('content.user'),
|
||||||
href: Em.computed.alias('user.path'),
|
href: Em.computed.alias('user.path'),
|
||||||
|
|
||||||
'data-user-expand': Em.computed.alias('user.username'),
|
'data-user-card': Em.computed.alias('user.username'),
|
||||||
|
|
||||||
render: function(buffer) {
|
render: function(buffer) {
|
||||||
var av = renderAvatar(this.get('content'), {usernamePath: 'user.username', imageSize: 'small'});
|
var av = renderAvatar(this.get('content'), {usernamePath: 'user.username', imageSize: 'small'});
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import CleansUp from 'discourse/mixins/cleans-up';
|
import CleansUp from 'discourse/mixins/cleans-up';
|
||||||
|
|
||||||
var clickOutsideEventName = "mousedown.outside-user-expansion",
|
var clickOutsideEventName = "mousedown.outside-user-card",
|
||||||
clickDataExpand = "click.discourse-user-expand",
|
clickDataExpand = "click.discourse-user-card",
|
||||||
clickMention = "click.discourse-user-mention";
|
clickMention = "click.discourse-user-mention";
|
||||||
|
|
||||||
export default Discourse.View.extend(CleansUp, {
|
export default Discourse.View.extend(CleansUp, {
|
||||||
elementId: 'user-expansion',
|
elementId: 'user-card',
|
||||||
classNameBindings: ['controller.visible::hidden', 'controller.showBadges'],
|
classNameBindings: ['controller.visible::hidden', 'controller.showBadges'],
|
||||||
allowBackgrounds: Discourse.computed.setting('allow_profile_backgrounds'),
|
allowBackgrounds: Discourse.computed.setting('allow_profile_backgrounds'),
|
||||||
|
|
||||||
addBackground: function() {
|
addBackground: function() {
|
||||||
var url = this.get('controller.user.expansion_background');
|
var url = this.get('controller.user.card_background');
|
||||||
if (!this.get('allowBackgrounds')) { return; }
|
if (!this.get('allowBackgrounds')) { return; }
|
||||||
|
|
||||||
var $this = this.$();
|
var $this = this.$();
|
||||||
@@ -21,7 +21,7 @@ export default Discourse.View.extend(CleansUp, {
|
|||||||
} else {
|
} else {
|
||||||
$this.css('background-image', "url(" + url + ")");
|
$this.css('background-image', "url(" + url + ")");
|
||||||
}
|
}
|
||||||
}.observes('controller.user.expansion_background'),
|
}.observes('controller.user.card_background'),
|
||||||
|
|
||||||
_setup: function() {
|
_setup: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -30,7 +30,7 @@ export default Discourse.View.extend(CleansUp, {
|
|||||||
$('html').off(clickOutsideEventName).on(clickOutsideEventName, function(e) {
|
$('html').off(clickOutsideEventName).on(clickOutsideEventName, function(e) {
|
||||||
if (self.get('controller.visible')) {
|
if (self.get('controller.visible')) {
|
||||||
var $target = $(e.target);
|
var $target = $(e.target);
|
||||||
if ($target.closest('.trigger-expansion').length > 0) { return; }
|
if ($target.closest('.trigger-user-card').length > 0) { return; }
|
||||||
if (self.$().has(e.target).length !== 0) { return; }
|
if (self.$().has(e.target).length !== 0) { return; }
|
||||||
|
|
||||||
self.get('controller').close();
|
self.get('controller').close();
|
||||||
@@ -39,10 +39,10 @@ export default Discourse.View.extend(CleansUp, {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#main-outlet').on(clickDataExpand, '[data-user-expand]', function(e) {
|
$('#main-outlet').on(clickDataExpand, '[data-user-card]', function(e) {
|
||||||
var $target = $(e.currentTarget);
|
var $target = $(e.currentTarget);
|
||||||
self._posterExpand($target);
|
self._posterExpand($target);
|
||||||
self.get('controller').show($target.data('user-expand'));
|
self.get('controller').show($target.data('user-card'));
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
@import "desktop/header";
|
@import "desktop/header";
|
||||||
@import "desktop/login";
|
@import "desktop/login";
|
||||||
@import "desktop/modal";
|
@import "desktop/modal";
|
||||||
@import "desktop/poster_expansion";
|
@import "desktop/user-card";
|
||||||
@import "desktop/topic-list";
|
@import "desktop/topic-list";
|
||||||
@import "desktop/topic-post";
|
@import "desktop/topic-post";
|
||||||
@import "desktop/topic";
|
@import "desktop/topic";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// styles that apply to the "share" popup when sharing a link to a post or topic
|
// styles that apply to the "share" popup when sharing a link to a post or topic
|
||||||
|
|
||||||
#user-expansion {
|
#user-card {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 460px;
|
width: 460px;
|
||||||
left: 20px;
|
left: 20px;
|
||||||
@@ -461,8 +461,8 @@ class UsersController < ApplicationController
|
|||||||
upload_avatar_for(user, upload)
|
upload_avatar_for(user, upload)
|
||||||
when "profile_background"
|
when "profile_background"
|
||||||
upload_profile_background_for(user.user_profile, upload)
|
upload_profile_background_for(user.user_profile, upload)
|
||||||
when "expansion_background"
|
when "card_background"
|
||||||
upload_expansion_background_for(user.user_profile, upload)
|
upload_card_background_for(user.user_profile, upload)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
render status: 422, text: upload.errors.full_messages
|
render status: 422, text: upload.errors.full_messages
|
||||||
@@ -492,8 +492,8 @@ class UsersController < ApplicationController
|
|||||||
image_type = params.require(:image_type)
|
image_type = params.require(:image_type)
|
||||||
if image_type == 'profile_background'
|
if image_type == 'profile_background'
|
||||||
user.user_profile.clear_profile_background
|
user.user_profile.clear_profile_background
|
||||||
elsif image_type == 'expansion_background'
|
elsif image_type == 'card_background'
|
||||||
user.user_profile.clear_expansion_background
|
user.user_profile.clear_card_background
|
||||||
else
|
else
|
||||||
raise Discourse::InvalidParameters.new(:image_type)
|
raise Discourse::InvalidParameters.new(:image_type)
|
||||||
end
|
end
|
||||||
@@ -554,8 +554,8 @@ class UsersController < ApplicationController
|
|||||||
render json: { url: upload.url, width: upload.width, height: upload.height }
|
render json: { url: upload.url, width: upload.width, height: upload.height }
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_expansion_background_for(user_profile, upload)
|
def upload_card_background_for(user_profile, upload)
|
||||||
user_profile.upload_expansion_background(upload)
|
user_profile.upload_card_background(upload)
|
||||||
render json: { url: upload.url, width: upload.width, height: upload.height }
|
render json: { url: upload.url, width: upload.width, height: upload.height }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module Jobs
|
|||||||
|
|
||||||
ignore_urls = []
|
ignore_urls = []
|
||||||
ignore_urls << UserProfile.uniq.where("profile_background IS NOT NULL AND profile_background != ''").pluck(:profile_background)
|
ignore_urls << UserProfile.uniq.where("profile_background IS NOT NULL AND profile_background != ''").pluck(:profile_background)
|
||||||
ignore_urls << UserProfile.uniq.where("expansion_background IS NOT NULL AND expansion_background != ''").pluck(:expansion_background)
|
ignore_urls << UserProfile.uniq.where("card_background IS NOT NULL AND card_background != ''").pluck(:card_background)
|
||||||
ignore_urls << Category.uniq.where("logo_url IS NOT NULL AND logo_url != ''").pluck(:logo_url)
|
ignore_urls << Category.uniq.where("logo_url IS NOT NULL AND logo_url != ''").pluck(:logo_url)
|
||||||
ignore_urls << Category.uniq.where("background_url IS NOT NULL AND background_url != ''").pluck(:background_url)
|
ignore_urls << Category.uniq.where("background_url IS NOT NULL AND background_url != ''").pluck(:background_url)
|
||||||
ignore_urls.flatten!
|
ignore_urls.flatten!
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ class UserProfile < ActiveRecord::Base
|
|||||||
cook
|
cook
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_expansion_background(upload)
|
def upload_card_background(upload)
|
||||||
self.expansion_background = upload.url
|
self.card_background = upload.url
|
||||||
self.save!
|
self.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_expansion_background
|
def clear_card_background
|
||||||
self.expansion_background = ""
|
self.card_background = ""
|
||||||
self.save!
|
self.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ end
|
|||||||
# bio_cooked :text
|
# bio_cooked :text
|
||||||
# dismissed_banner_key :integer
|
# dismissed_banner_key :integer
|
||||||
# profile_background :string(255)
|
# profile_background :string(255)
|
||||||
# expansion_background :string(255)
|
# card_background :string(255)
|
||||||
# bio_cooked_version :integer
|
# bio_cooked_version :integer
|
||||||
#
|
#
|
||||||
# Indexes
|
# Indexes
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class UserSerializer < BasicUserSerializer
|
|||||||
:created_at,
|
:created_at,
|
||||||
:website,
|
:website,
|
||||||
:profile_background,
|
:profile_background,
|
||||||
:expansion_background,
|
:card_background,
|
||||||
:location,
|
:location,
|
||||||
:can_edit,
|
:can_edit,
|
||||||
:can_edit_username,
|
:can_edit_username,
|
||||||
@@ -118,12 +118,12 @@ class UserSerializer < BasicUserSerializer
|
|||||||
profile_background.present?
|
profile_background.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def expansion_background
|
def card_background
|
||||||
object.user_profile.expansion_background
|
object.user_profile.card_background
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_expansion_background?
|
def include_card_background?
|
||||||
expansion_background.present?
|
card_background.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def location
|
def location
|
||||||
|
|||||||
@@ -373,9 +373,9 @@ en:
|
|||||||
title: "Profile Background"
|
title: "Profile Background"
|
||||||
instructions: "Profile backgrounds will be centered and have a default width of 850px."
|
instructions: "Profile backgrounds will be centered and have a default width of 850px."
|
||||||
|
|
||||||
change_expansion_background:
|
change_card_background:
|
||||||
title: "User Expansion Background"
|
title: "User Card Background"
|
||||||
instructions: "Expansion images will be centered and have a default width of 590px."
|
instructions: "Background images will be centered and have a default width of 590px."
|
||||||
|
|
||||||
email:
|
email:
|
||||||
title: "Email"
|
title: "Email"
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ pt_BR:
|
|||||||
change_profile_background:
|
change_profile_background:
|
||||||
title: "Fundo do perfil"
|
title: "Fundo do perfil"
|
||||||
instructions: "Fundos do perfil será centralizado e tera uma largura padrão de 850px."
|
instructions: "Fundos do perfil será centralizado e tera uma largura padrão de 850px."
|
||||||
change_expansion_background:
|
change_card_background:
|
||||||
title: "Fundo de Expansão do Usuário"
|
title: "Fundo de Expansão do Usuário"
|
||||||
instructions: "Imagens de Expansão será centralizado e tera uma largura padrão de 590px."
|
instructions: "Imagens de Expansão será centralizado e tera uma largura padrão de 590px."
|
||||||
email:
|
email:
|
||||||
|
|||||||
5
db/migrate/20141020154935_rename_expansion_to_card.rb
Normal file
5
db/migrate/20141020154935_rename_expansion_to_card.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class RenameExpansionToCard < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
rename_column :user_profiles, :expansion_background, :card_background
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1156,13 +1156,13 @@ describe UsersController do
|
|||||||
json['height'].should == 200
|
json['height'].should == 200
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is successful for expansion backgrounds' do
|
it 'is successful for card backgrounds' do
|
||||||
upload = Fabricate(:upload)
|
upload = Fabricate(:upload)
|
||||||
Upload.expects(:create_for).returns(upload)
|
Upload.expects(:create_for).returns(upload)
|
||||||
xhr :post, :upload_user_image, username: user.username, file: user_image, image_type: "expansion_background"
|
xhr :post, :upload_user_image, username: user.username, file: user_image, image_type: "card_background"
|
||||||
user.reload
|
user.reload
|
||||||
|
|
||||||
user.user_profile.expansion_background.should == "/uploads/default/1/1234567890123456.png"
|
user.user_profile.card_background.should == "/uploads/default/1/1234567890123456.png"
|
||||||
|
|
||||||
# returns the url, width and height of the uploaded image
|
# returns the url, width and height of the uploaded image
|
||||||
json = JSON.parse(response.body)
|
json = JSON.parse(response.body)
|
||||||
@@ -1220,12 +1220,12 @@ describe UsersController do
|
|||||||
json['height'].should == 200
|
json['height'].should == 200
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is successful for expansion backgrounds' do
|
it 'is successful for card backgrounds' do
|
||||||
upload = Fabricate(:upload)
|
upload = Fabricate(:upload)
|
||||||
Upload.expects(:create_for).returns(upload)
|
Upload.expects(:create_for).returns(upload)
|
||||||
xhr :post, :upload_user_image, username: user.username, file: user_image_url, image_type: "expansion_background"
|
xhr :post, :upload_user_image, username: user.username, file: user_image_url, image_type: "card_background"
|
||||||
user.reload
|
user.reload
|
||||||
user.user_profile.expansion_background.should == "/uploads/default/1/1234567890123456.png"
|
user.user_profile.card_background.should == "/uploads/default/1/1234567890123456.png"
|
||||||
|
|
||||||
# returns the url, width and height of the uploaded image
|
# returns the url, width and height of the uploaded image
|
||||||
json = JSON.parse(response.body)
|
json = JSON.parse(response.body)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ page.runTests = function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("has details",function(){
|
test("has details",function(){
|
||||||
return $('#user-expansion .names').length === 1;
|
return $('#user-card .names').length === 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
run();
|
run();
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ describe UserSerializer do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with filled out expansion background" do
|
context "with filled out card background" do
|
||||||
before do
|
before do
|
||||||
user.user_profile.expansion_background = 'http://expansion.com'
|
user.user_profile.card_background = 'http://card.com'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has a profile background" do
|
it "has a profile background" do
|
||||||
expect(json[:expansion_background]).to eq 'http://expansion.com'
|
expect(json[:card_background]).to eq 'http://card.com'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
13
test/javascripts/integration/user-card-test.js.es6
Normal file
13
test/javascripts/integration/user-card-test.js.es6
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
integration("User Card");
|
||||||
|
|
||||||
|
test("card", function() {
|
||||||
|
visit('/');
|
||||||
|
|
||||||
|
ok(find('#user-card:visible').length === 0, 'user card is invisible by default');
|
||||||
|
click('a[data-user-card=eviltrout]:first');
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
ok(find('#user-card:visible').length === 1, 'card should appear');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
integration("User Expansion");
|
|
||||||
|
|
||||||
test("expansion", function() {
|
|
||||||
visit('/');
|
|
||||||
|
|
||||||
ok(find('#user-expansion:visible').length === 0, 'user expansion is invisible by default');
|
|
||||||
click('a[data-user-expand=eviltrout]:first');
|
|
||||||
|
|
||||||
andThen(function() {
|
|
||||||
ok(find('#user-expansion:visible').length === 1, 'expansion should appear');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user