This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe LikeHelper do | |
subject { LikeHelper } | |
describe "should render the correct line" do | |
before(:each) do | |
@user = Factory(:user) | |
@users = FactoryGirl.create_list(:user, 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["gogobot/util"], function(util) { | |
util.createPhoto("##{media.id}", { height: 150, width: 200, border: 0, src: "#{{media.media.thumb(Media::MEDIUM_SIZE)}}"}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def method_missing(name, *args, &block) | |
obj = self | |
obj = @activity unless self.respond_to?(name) | |
obj.send(name, *args, &block) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
number_of_photos = ItemsMedia.count(:joins => :media, | |
:conditions => ["owner_id=? AND item_type IS NOT NULL AND item_type NOT IN ('User', 'Postcard')", user.id], | |
:select => "DISTINCT media_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_locale | |
logger.info request.remote_ip.to_s | |
current_user.update_country(request.remote_ip.to_s) | |
country_code = current_user.country.code.downcase.to_sym | |
logger.info "Country Code: #{country_code}" | |
I18n.locale = country_code || I18n.default_locale | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("click", "a.like-button", function(e) { | |
e.preventDefault(); | |
var button = $(this); | |
var data = button.data(); | |
var state = button.attr('class').indexOf('true') > 0; | |
ana.trackEvent('Likes', state ? 'like' : 'unlike', data['itemtype']); | |
var item_id = data['itemid']; | |
var item_type = data['itemtype']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spec do | |
Rspec::Core::RakeTask.new(:unit) do |t| | |
t.pattern = Dir['spec/*/**/*_spec.rb'].reject{ |f| f['/api/v1'] || f['/integration'] } | |
end | |
Rspec::Core::RakeTask.new(:api) do |t| | |
t.pattern = "spec/*/{api/v1}*/**/*_spec.rb" | |
end | |
Rspec::Core::RakeTask.new(:integration) do |t| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle exec rake spec:unit | |
bundle exec rake spec:api | |
bundle exec rake spec:integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spec do | |
Rspec::Core::RakeTask.new(:unit) do |t| | |
t.pattern = Dir['spec/*/**/*_spec.rb'].reject{ |f| f['/api/v1'] || f['/integration'] } | |
end | |
Rspec::Core::RakeTask.new(:api) do |t| | |
t.pattern = "spec/*/{api/v1}*/**/*_spec.rb" | |
end | |
Rspec::Core::RakeTask.new(:integration) do |t| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notifier.should_receive(:issue_status_change).with(@main_user, Issue.first) |