Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Just simple content

  • Loading branch information...
commit 7cca279437799a043bc56a8f17dcbaea190d24c6 1 parent a41710e
@equivalent authored
View
6 wisdom_inside/scraps/raspberrypi
@@ -0,0 +1,6 @@
+
+
+# youtube on raspberry pi
+
+ sudo apt-get install gnash
+ sudo apt-get install browser-plugin-gnash
View
37 wisdom_inside/scraps2/carrierwave
@@ -2,6 +2,8 @@
# how to have different storage in test enviroment for carrierwave
+using initializer
+
# config/initializers/carrierwave.rb
if Rails.env.test? or Rails.env.cucumber?
CarrierWave.configure do |config|
@@ -14,4 +16,39 @@
end
end
+but better solution is with module
+
+
+
+# factory girl of model using carrierwave
+
+ FactoryGirl.define do
+ factory :archive_file do
+ association :archive
+ title "MyString"
+ description "MyText"
+
+ trait :with_file do
+ after(:build) do |af|
+ af[:file] = 'dummy.txt'
+ end
+ end
+ end
+ end
+
+ FactoryGirl.build :archive_file, with_file
+
+or better
+
+ # Read about factories at https://github.com/thoughtbot/factory_girl
+ include ActionDispatch::TestProcess
+ FactoryGirl.define do
+ factory :photo do
+ association :event
+ association :entry
+ photo { fixture_file_upload(Rails.root.join(*%w[spec fixtures files example.jpg]), 'image/jpg') }
+ description "MyString"
+ end
+ end
+
Please sign in to comment.
Something went wrong with that request. Please try again.