Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View osiro's full-sized avatar

Vinny Osiro osiro

View GitHub Profile
en:
app:
name: 'vocortex'
admin:
agencies:
add_credit_form:
title: 'Add Credits to Agency'
index:
title: 'Agencies'
en:
app:
name: 'vocortex'
admin:
agencies:
add_credit_form:
title: 'Add Credits to Agency'
index:
title: 'Agencies'
require 'spec_helper'
feature 'User can view book' do
scenario 'Providing valid params' do
sign_in
click_on_dashboard
search_for_book
click_on_book_thumbnail
#... rest of the test goes here
FactoryGirl.define do
factory :agency do
#... other fields
profile_image { File.open(Rails.root.join('spec', 'support', 'files', 'image-600.jpeg')) }
banner_image { File.open(Rails.root.join('spec', 'support', 'files', 'image.jpeg')) }
end
FactoryGirl.define do
factory :agency do
heaps_of_users_wishlists = UsersWishlist.where(user: user)
heaps_of_groups = BookIdentifierGroup.where(id: heaps_of_users_wishlists.pluck(:book_identifier_group_id)
the_book_identifiers_I_wanna = BookIdentifier.where(group_id: heaps_of_groups.pluck(:id))
puts the_book_identifiers_I_wanna
# This shit triggers 3 queries
heaps_of_users_wishlists = UsersWishlist.where(user: user)
heaps_of_groups = BookIdentifierGroup.joins(:users_wishlists).merge(heaps_of_users_wishlists)
class Tongln.AjaxRequester
constructor: (options) ->
@options = options
send: ->
$.ajax(@options)
.done (data, textStatus, jqXHR) =>
Tongln.DebugHelpers.logSuccessAjax(data, textStatus, jqXHR)
.error (jqXHR, textStatus, errorThrown) =>
Tongln.DebugHelpers.logFailAjax(jqXHR, textStatus, errorThrown)
RSpec.configure do |config|
config.before(:suite) do
Warden.test_mode!
end
config.after(:each) do |example|
Warden.test_reset!
end
ENV["RAILS_ENV"] ||= 'test'
require 'simplecov'
require 'simplecov-rcov'
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start 'rails'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'pundit/rspec'
# 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 'spree/testing_support/factories'
require 'spree_product_contributors/factories'
require 'capybara/poltergeist'
require 'simplecov'
require 'email_spec'
Instance method "open" is already defined in Object, use generic helper instead or set StateMachine::Machine.ignore_method_conflicts = true.
Admins can edit a contributor's links
{"relname"=>"spree_stock_locations", "rowcount"=>"1"}
{"relname"=>"spree_prices", "rowcount"=>"3"}
{"relname"=>"spree_option_types", "rowcount"=>"2"}
{"relname"=>"spree_shipping_categories", "rowcount"=>"1"}
{"relname"=>"spree_coverings", "rowcount"=>"2"}
{"relname"=>"spree_products", "rowcount"=>"1"}
{"relname"=>"spree_variant_statuses", "rowcount"=>"2"}