Merge pull request #477 from metamaps/feature/metacode-icon-on-aws

metacode icons on aws (fixes #445)
This commit is contained in:
Devin Howard 2016-02-28 12:19:00 +08:00
commit 8916ff20b6
12 changed files with 332 additions and 128 deletions

View file

@ -272,6 +272,3 @@ DEPENDENCIES
tunemygc
uglifier
uservoice-ruby
BUNDLED WITH
1.11.2

View file

@ -1,63 +0,0 @@
.allMetacodes {
float:left;
}
.allMetacodes span {
margin:4px 8px;
color:#67AF9F;
}
.editMetacodes {
z-index:12;
width:auto;
color: #67AF9F;
padding:10px;
float:left;
}
.editMetacodes ul {
display:block;
}
.editMetacodes ul li {
clear:both;
list-style-type:none;
display:block;
padding:3px;
}
.editMetacodes ul img {
width:40px;
height:40px;
float:left;
}
.editMetacodes ul p {
float:left;
display: block;
margin: 0;
background: none;
padding: 10px 4px 2px 4px;
}
.editMetacodes #filters-one {
float:left;
}
.editMetacodes #filters-two {
float:left;
}
.editMetacodes #filters-three {
float:left;
}
.editMetacodes #filters-four {
float:left;
}
.editMetacodes li.toggledOff {
opacity: 0.4;
}

View file

@ -0,0 +1,188 @@
.allMetacodes {
float:left;
span {
margin:4px 8px;
color:#67AF9F;
}
}
.editMetacodes {
z-index:12;
width:auto;
color: #67AF9F;
padding:10px;
float:left;
ul {
display:block;
}
ul li {
clear:both;
list-style-type:none;
display:block;
padding:3px;
}
ul img {
width:40px;
height:40px;
float:left;
}
ul p {
float:left;
display: block;
margin: 0;
background: none;
padding: 10px 4px 2px 4px;
}
#filters-one {
float:left;
}
#filters-two {
float:left;
}
#filters-three {
float:left;
}
#filters-four {
float:left;
}
li.toggledOff {
opacity: 0.4;
}
}
.blackBox {
width: 760px;
margin: 0 auto;
padding: 20px 0 60px 20px;
background: rgba(0, 0, 0, 0.4);
color: white;
overflow: hidden;
position: relative;
.metacodeSetsDescription {
width: 314px;
}
td.metacodeSetDesc {
width: 314px;
word-wrap: break-word;
}
.metacodeSetImage {
width: 36px;
height: 36px;
float: left;
}
tr {
display: table-row;
}
tr:nth-child(odd) {
background: rgba(0, 0, 0, 0.2);
}
tr:nth-child(even) {
background: rgba(0, 0, 0, 0.3);
}
th,
td {
padding: 10px;
}
td.iconURL {
max-width: 415px;
word-wrap: break-word;
}
.field {
margin: 15px 0 5px;
}
label {
float: left;
width: 100px;
margin-right: 15px;
margin-top: 0px;
}
input[type="text"] {
width: 336px;
height: 32px;
font-size: 15px;
direction: ltr;
-webkit-appearance: none;
appearance: none;
display: inline-block;
margin: 0;
padding: 0 8px;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
font: -webkit-small-control;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
font-family: arial;
}
textarea:hover,
input[type="text"]:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
textarea {
padding: 8px;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
resize: none;
font: -webkit-small-control;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
text-align: start;
font-family: arial;
font-size: 15px;
line-height: 17px;
width: 318px;
}
.allMetacodes {
padding: 5px 0;
}
a.button {
margin-right: 20px;
line-height: 40px;
}
a.button,
input.add {
float: left;
margin-top: 5px;
height: 40px;
font-size: 17px;
width: auto;
padding: 0 30px;
cursor: pointer;
font-weight: normal;
}
a.button:hover,
input.add:hover {
-webkit-box-shadow: none;
box-shadow: none;
}
}

View file

@ -5,9 +5,6 @@ class MetacodesController < ApplicationController
# GET /metacodes.json
def index
@metacodes = Metacode.order("name").all
@metacodes.map do |metacode|
metacode.icon = ActionController::Base.helpers.asset_path(metacode.icon)
end
respond_to do |format|
format.html {
@ -73,6 +70,6 @@ class MetacodesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def metacode_params
params.require(:metacode).permit(:id, :name, :icon, :color)
params.require(:metacode).permit(:id, :name, :aws_icon, :manual_icon, :color)
end
end

View file

@ -3,6 +3,35 @@ class Metacode < ActiveRecord::Base
has_many :metacode_sets, :through => :in_metacode_sets
has_many :topics
# This method associates the attribute ":aws_icon" with a file attachment
has_attached_file :aws_icon, :styles => {
:ninetysix => ['96x96#', :png],
},
:default_url => 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png'
# Validate the attached icon is image/jpg, image/png, etc
validates_attachment_content_type :aws_icon, :content_type => /\Aimage\/.*\Z/
validate :aws_xor_manual_icon
validate :manual_icon_https
before_create do
self.manual_icon = nil if self.manual_icon == ""
end
def icon(*args)
if manual_icon.present?
manual_icon
else
aws_icon(*args)
end
end
def as_json(options={})
default = super(options)
default[:icon] = icon
default.except('aws_icon_file_name', 'aws_icon_content_type', 'aws_icon_file_size', 'aws_icon_updated_at', 'manual_icon')
end
def hasSelected(user)
return true if user.settings.metacodes.include? self.id.to_s
return false
@ -12,4 +41,23 @@ class Metacode < ActiveRecord::Base
return true if self.metacode_sets.include? metacode_set
return false
end
private
def aws_xor_manual_icon
if aws_icon.blank? && manual_icon.blank?
errors.add(:base, "Either aws_icon or manual_icon is required")
end
if aws_icon.present? && manual_icon.present?
errors.add(:base, "Specify aws_icon or manual_icon, not both")
end
end
def manual_icon_https
if manual_icon.present?
unless manual_icon.starts_with? 'https'
errors.add(:base, "Manual icon must begin with https")
end
end
end
end

View file

@ -2,7 +2,6 @@
<% if @metacode.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@metacode.errors.count, "error") %> prohibited this metacode from being saved:</h2>
<ul>
<% @metacode.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
@ -16,9 +15,20 @@
<%= f.text_field :name %>
<div class="clearfloat"></div>
</div>
<% unless @metacode.new_record? %>
<div class="field">
<%= f.label 'Current Icon' %>
<%= image_tag @metacode.icon, width: 96 %>
</div>
<% end %>
<div class="field">
<%= f.label :icon %>
<%= f.text_field :icon %>
<% if @metacode.new_record? %>
<%= f.label 'Icon' %>
<% else %>
<%= f.label 'Replace Icon: ' %>
<% end %>
<%= f.hidden_field :manual_icon, value: nil %>
<%= f.file_field :aws_icon %>
<div class="clearfloat"></div>
</div>
<div class="field">

View file

@ -14,7 +14,7 @@
<% @metacodes.each do |metacode| %>
<tr>
<td><%= metacode.name %></td>
<td class="iconURL"><%= asset_path metacode.icon %></td>
<td class="iconURL"><%= metacode.icon %></td>
<% if metacode.color %>
<td class="iconColor" style="background-color: <%= metacode.color %>">
<%= metacode.color %>
@ -22,7 +22,7 @@
<% else %>
<td></td>
<% end %>
<td><img width='40' src='<%= asset_path metacode.icon %>' /></td>
<td><%= image_tag metacode.icon, width: 40 %></td>
<td><%= link_to 'Edit', edit_metacode_path(metacode), :data => { :bypass => 'true'} %></td>
</tr>
<% end %>

View file

@ -0,0 +1,8 @@
class AddAttachmentIconToMetacodes < ActiveRecord::Migration
def change
change_table :metacodes do |t|
t.rename :icon, :manual_icon
t.attachment :aws_icon
end
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160120061513) do
ActiveRecord::Schema.define(version: 20160223061711) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -63,6 +63,19 @@ ActiveRecord::Schema.define(version: 20160120061513) do
add_index "maps", ["user_id"], name: "index_maps_on_user_id", using: :btree
create_table "messages", force: :cascade do |t|
t.text "message"
t.integer "user_id"
t.integer "resource_id"
t.string "resource_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "messages", ["resource_id"], name: "index_messages_on_resource_id", using: :btree
add_index "messages", ["resource_type"], name: "index_messages_on_resource_type", using: :btree
add_index "messages", ["user_id"], name: "index_messages_on_user_id", using: :btree
create_table "metacode_sets", force: :cascade do |t|
t.string "name"
t.text "desc"
@ -76,10 +89,14 @@ ActiveRecord::Schema.define(version: 20160120061513) do
create_table "metacodes", force: :cascade do |t|
t.text "name"
t.string "icon"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "manual_icon"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "color"
t.string "aws_icon_file_name"
t.string "aws_icon_content_type"
t.integer "aws_icon_file_size"
t.datetime "aws_icon_updated_at"
end
create_table "synapses", force: :cascade do |t|

View file

@ -24,283 +24,283 @@ User.new({
## METACODES
Metacode.create({
name: 'Action',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_action.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_action.png',
color: '#BD6C85'
})
Metacode.create({
name: 'Activity',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_activity.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_activity.png',
color: '#6EBF65'
})
Metacode.create({
name: 'Catalyst',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_catalyst.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_catalyst.png',
color: '#EF8964',
})
Metacode.create({
name: 'Closed',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_closedissue.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_closedissue.png',
color: '#ABB49F',
})
Metacode.create({
name: 'Process',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_process.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_process.png',
color: '#BDB25E',
})
Metacode.create({
name: 'Future',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_futuredev.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_futuredev.png',
color: '#25A17F',
})
Metacode.create({
name: 'Group',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_group.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_group.png',
color: '#7076BC',
})
Metacode.create({
name: 'Implication',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_implication.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_implication.png',
color: '#83DECA',
})
Metacode.create({
name: 'Insight',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_insight.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_insight.png',
color: '#B074AD',
})
Metacode.create({
name: 'Intention',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_intention.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_intention.png',
color: '#BAEAFF',
})
Metacode.create({
name: 'Knowledge',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_knowledge.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_knowledge.png',
color: '#60ACF7',
})
Metacode.create({
name: 'Location',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_location.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_location.png',
color: '#ABD9A7',
})
Metacode.create({
name: 'Need',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_need.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_need.png',
color: '#D2A7D4',
})
Metacode.create({
name: 'Open',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_openissue.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_openissue.png',
color: '#9BBF71',
})
Metacode.create({
name: 'Opportunity',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_opportunity.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_opportunity.png',
color: '#889F64',
})
Metacode.create({
name: 'Person',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_person.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_person.png',
color: '#DE925F',
})
Metacode.create({
name: 'Platform',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_platform.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_platform.png',
color: '#21C8FE',
})
Metacode.create({
name: 'Problem',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_problem.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_problem.png',
color: '#99CFC4',
})
Metacode.create({
name: 'Resource',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_resource.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_resource.png',
color: '#C98C63',
})
Metacode.create({
name: 'Role',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_role.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_role.png',
color: '#A8595D',
})
Metacode.create({
name: 'Task',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_task.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_task.png',
color: '#3397C4',
})
Metacode.create({
name: 'Trajectory',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_trajectory.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/blueprint/96px/bp_trajectory.png',
color: '#D3AA4C',
})
Metacode.create({
name: 'Argument',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_argument.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_argument.png',
color: '#7FAEFD',
})
Metacode.create({
name: 'Con',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_con.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_con.png',
color: '#CF7C74',
})
Metacode.create({
name: 'Subject',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_subject.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_subject.png',
color: '#8293D8',
})
Metacode.create({
name: 'Decision',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_decision.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_decision.png',
color: '#CCA866',
})
Metacode.create({
name: 'Event',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_event.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_event.png',
color: '#F5854B',
})
Metacode.create({
name: 'Example',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_example.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_example.png',
color: '#618C61',
})
Metacode.create({
name: 'Experience',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_experience.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_experience.png',
color: '#BE995F',
})
Metacode.create({
name: 'Feedback',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_feedback.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_feedback.png',
color: '#54A19D',
})
Metacode.create({
name: 'Aim',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_aim.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_aim.png',
color: '#B0B0B0',
})
Metacode.create({
name: 'Good',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_goodpractice.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_goodpractice.png',
color: '#BD9E86',
})
Metacode.create({
name: 'Idea',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_idea.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_idea.png',
color: '#C4BC5E',
})
Metacode.create({
name: 'List',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_list.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_list.png',
color: '#B7A499',
})
Metacode.create({
name: 'Media',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_media.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_media.png',
color: '#6D94CC',
})
Metacode.create({
name: 'Metamap',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_metamap.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_metamap.png',
color: '#AEA9FD',
})
Metacode.create({
name: 'Model',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_model.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_model.png',
color: '#B385BA',
})
Metacode.create({
name: 'Note',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_note.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_note.png',
color: '#A389A1',
})
Metacode.create({
name: 'Perspective',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_perspective.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_perspective.png',
color: '#2EB6CC',
})
Metacode.create({
name: 'Pro',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_pro.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_pro.png',
color: '#89B879',
})
Metacode.create({
name: 'Project',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_project.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_project.png',
color: '#85A050',
})
Metacode.create({
name: 'Question',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_question.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_question.png',
color: '#5CB3B3',
})
Metacode.create({
name: 'Reference',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_reference.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_reference.png',
color: '#A7A7A7',
})
Metacode.create({
name: 'Research',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_research.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_research.png',
color: '#CD8E89',
})
Metacode.create({
name: 'Status',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_status.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_status.png',
color: '#EFA7C0',
})
Metacode.create({
name: 'Tool',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_tool.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_tool.png',
color: '#828282',
})
Metacode.create({
name: 'Wildcard',
icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png',
manual_icon: 'https://s3.amazonaws.com/metamaps-assets/metacodes/generics/96px/gen_wildcard.png',
color: '#73C7DE',
})
## END METACODES

View file

@ -55,7 +55,8 @@ RSpec.describe MetacodesController, type: :controller do
describe 'PUT #update' do
context 'with valid params' do
let(:new_attributes) do
{ icon: 'https://newimages.ca/cool-image.jpg',
{ manual_icon: 'https://newimages.ca/cool-image.jpg',
aws_icon: nil,
color: '#ffffff',
name: 'Cognition' }
end

View file

@ -1,7 +1,8 @@
FactoryGirl.define do
factory :metacode do
sequence(:name) { |n| "Cool Metacode ##{n}" }
icon 'https://images.com/image.png'
manual_icon 'https://images.com/image.png'
aws_icon nil
color '#cccccc'
end
end