Skip to content

Instantly share code, notes, and snippets.

View gen1321's full-sized avatar
🏠
Working from home

Boris Beginin gen1321

🏠
Working from home
View GitHub Profile
def comment
@comment = @post.comments.create(comment_params)
@comment[:state]= "approved"
@comment[:spam]= false
if @comment.valid?
if Comment::Moderation.enabled? or @comment.ham?
begin
CommentMailer.notification(@comment, request).deliver_now
Sass::SyntaxError in Static_pages#home
Showing /home/gen/upwork/dunno/globalagritrends.com.code (1)/app/views/layouts/application.html.haml where line #12 raised:
".content table" failed to @extend ".table".
The selector ".table" was not found.
Use "@extend .table !optional" if the extend should be able to fail.
(in /home/gen/upwork/dunno/globalagritrends.com.code (1)/app/assets/stylesheets/layout.css.scss.erb)
require 'nokogiri'
t = ('<div class="listing">
<div class="row">
<span class="left">Title:</span>
<span class="right">The Well-Grounded Rubyist</span>
</div>
<div class="row">
<span class="left">Author:</span>
<span class="right">David A. Black</span>
</div>
@gen1321
gen1321 / simple-capistrano-docker-deploy.rb
Created April 9, 2016 21:38 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
#require 'rubygems'
#require 'Celerity'
require 'nokogiri'
require 'watir-webdriver'
require "open-uri"
#b.goto 'bit.ly/watir-webdriver-demo'
#b.text_field(:id => 'entry_1000000').set 'your name'
#b.select_list(:id => 'entry_1000001').select 'Ruby'
#b.select_list(:id => 'entry_1000001').selected? 'Ruby'
# == Schema Information
#
# Table name: users
#
# *id*:: <tt>integer, not null, primary key</tt>
# *email*:: <tt>string, default(""), not null</tt>
# *encrypted_password*:: <tt>string, default(""), not null</tt>
# *reset_password_token*:: <tt>string</tt>
# *reset_password_sent_at*:: <tt>datetime</tt>
# *remember_created_at*:: <tt>datetime</tt>
class CreatePermissions < ActiveRecord::Migration
def change
create_table :permissions do |t|
t.integer :publisher_id
t.integer :channel_id
t.timestamps null: false
end
end
end
require 'rails_helper'
describe History ,type: :model do
let(:member){ create(:member) }
let(:channel){ create(:channel) }
let(:create_sub){create(:subscription )}
it 'should be created after subscribe' do
expect{create_sub}.to change{History.count}.by(1)
end
require 'rails_helper'
describe "the signin process", :type => :feature do
before :each do
AdminUser.create(:email => 'user@example.com', :password => 'password')
end
let(:sign_in) { visit '/admin'
within("#session_new") do
fill_in 'Email', :with => 'user@example.com'
fill_in 'Password', :with => 'password'
<%= message.subject %>
<%= message.render_body.html_safe %>
<%= message.published_at%>