Skip to content

Instantly share code, notes, and snippets.

FactoryGirl.define do
factory :user do
name { FFaker::Name.name }
password { FFaker::Internet.password(8) }
email { FFaker::Internet.email }
confirmed_at Date.today
end
end
FactoryGirl.define do
require 'acceptance_helper'
feature 'Survey', js: true do
given!(:user) { create(:user) }
given!(:organization) { create(:organization, owner: user) }
background do
login_as_user(user)
end
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'shoulda/matchers'
require 'capybara/rspec'
require 'capybara/poltergeist'
require "rack_session_access/capybara"
require 'sidekiq/testing'
directive = ->
restrict: 'A'
link: ($scope, $elem, $attrs) ->
$elem.mouseover( ->
console.log('test')
).mouseout( ->
console.log('test')
)
directive = ->
restrict: 'A'
link: ($scope, $elem, $attrs) ->
$elem.mouseover( ->
console.log('test')
).mouseout( ->
console.log('test')
)
.rewards__header-mobile
.rewards__header-mobile--rewards-block.rewards__mobile-code-block
.container
%p.rewards__header-mobile--article-code
Rewards Code:
%span.rewards__header-mobile--code
Med123
.rewards__header-mobile--rewards-info-block.rewards__mobile-rewards-block
.container
.row
var App = {
init: function() {
area = document.getElementById('actionBoard');
chrome.tabs.onActivated.addListener(function(e) {
chrome.tabs.query({active: true}, function(active) {
chrome.tabs.getCurrent(function(current) {
area.innerHTML = window.localStorage.getItem('content');
});
});
});
class PostsController < ApplicationController
before_action :authenticate
caches_action :index, :show
def index
@posts = Post.all
end
def show
@post = Post.find_by(id: params[:id])
<% Order.all.each do |o| %>
<%= o.buyer.name %> bought <%= o.product.name %>
<% end %>
<% cache do %>
All available products:
<% Product.all.each do |p| %>
<%= link_to p.name, product_url(p) %>
<% end %>
<% end %>
class AboutController < ApplicationController
caches_page :index
def index
end
end