mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Temorary spec for generator
You can run generator spec by doing: GENERATOR_SPEC=true rake spec:ative_record_41 We are doing this because we don't want to make API calls in the spec. At the same time, we aldo don't want to use fakeweb or something like that because it causes "you never realize until you go production" situation. We had it before and shipped a bug - we are not sure what is a better solution, but at long as I'm aware of this I'll take care of it.
This commit is contained in:
parent
25e0d2865a
commit
d8c568f05e
2 changed files with 19 additions and 0 deletions
18
spec/generators/views_generator_spec.rb
Normal file
18
spec/generators/views_generator_spec.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'spec_helper'
|
||||
|
||||
if defined?(Rails)
|
||||
require 'rails/generators'
|
||||
require 'generators/kaminari/views_generator'
|
||||
|
||||
describe Kaminari::Generators::GitHubApiHelper, :generator_spec => true do
|
||||
describe '.get_files_in_master' do
|
||||
subject { Kaminari::Generators::GitHubApiHelper.get_files_in_master }
|
||||
it { should include(["README", "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"]) }
|
||||
end
|
||||
|
||||
describe '.get_content_for' do
|
||||
subject { Kaminari::Generators::GitHubApiHelper.get_content_for("README") }
|
||||
it { should == "" }
|
||||
end
|
||||
end
|
||||
end
|
|
@ -30,4 +30,5 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|||
|
||||
RSpec.configure do |config|
|
||||
config.mock_with :rr
|
||||
config.filter_run_excluding :generator_spec => true if !ENV['GENERATOR_SPEC']
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue