A clean workaround for running capybara tests on Rails with assets pipeline enabled.
Original: teamcapybara/capybara#500 (comment)
| require 'rails_helper' | |
| RSpec.describe "employees#create", type: :request do | |
| subject(:make_request) do | |
| jsonapi_post "/api/v1/employees", payload | |
| end | |
| describe 'basic create' do | |
| let(:payload) do | |
| { |
| # Cleans up branches like: | |
| # if Shopify.rails_next? | |
| # # Rails 5 login | |
| # else | |
| # # Rails 4 login | |
| # end | |
| module RuboCop | |
| module Cop | |
| module ShopifyRails | |
| class RailsNextUnless < Cop |
A clean workaround for running capybara tests on Rails with assets pipeline enabled.
Original: teamcapybara/capybara#500 (comment)
I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an AirPort Time Capsule that backs up everything using Time Machine, but I don't want all the crap I had in the old one. So let's get our hands dirty!
| I use the first | |
| —– BEGIN LICENSE —– | |
| Michael Barnes | |
| Single User License | |
| EA7E-821385 | |
| 8A353C41 872A0D5C DF9B2950 AFF6F667 | |
| C458EA6D 8EA3C286 98D1D650 131A97AB | |
| AA919AEC EF20E143 B361B1E7 4C8B7F04 |
| #!/bin/sh | |
| # Licence: MIT | |
| # Created by tomykaira, 2011-10-25 | |
| if [ $# -ne 1 ]; then | |
| echo "Give me your new project name (only)" | |
| exit 1 | |
| fi |
| # | |
| # A: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.subscribe do |data| | |
| # puts "data: #{data} is coming!" | |
| # end | |
| # | |
| # B: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.publish("hello world") |
| class Api::UploadsController < ApiController | |
| def create | |
| @upload = Upload.new(upload_params) | |
| ensure | |
| clean_tempfile | |
| end | |
| private |