cadenero 0.0.2.a1 → 0.0.2.a2

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,9 +16,31 @@ describe Cadenero::Generators::InstallGenerator do
16
16
  Dir["#{Rails.root}/db/migrate/*.rb"].sort
17
17
  end
18
18
 
19
-
19
+ it "copies over the migrations" do
20
+ migrations.should be_empty
21
+ capture(:stdout) do
22
+ described_class.start(["--user-class=User", "--no-migrate", "--current-user-helper=current_user",
23
+ "--default-account-name=Root", "--default-account-subdomain=www", "--default-user-email=testy@example.com",
24
+ "--default-user-password=change-me"], :destination => Rails.root)
25
+ end
26
+
27
+ # Ensure cadenero migrations have been copied over
28
+ migrations.should_not be_empty
29
+
30
+ # Ensure initializer has been created
31
+ #cadenero_initializer = File.readlines("#{Rails.root}/config/initializers/cadenero.rb")
32
+ #cadenero_initializer[0].strip.should == %q{Cadenero.user_class = "User"}
33
+
34
+ # Ensure cadenero_user is added to ApplicationController
35
+ application_controller = File.read("#{Rails.root}/app/controllers/application_controller.rb")
36
+ expected_cadenero_user_method = %Q{
37
+ def cadenero_user
38
+ current_user
39
+ end
40
+ helper_method :cadenero_user
20
41
 
21
- it "seeds the database" do
42
+ }
43
+ application_controller.should include(expected_cadenero_user_method)
22
44
  Cadenero::V1::Account.count.should == 0
23
45
  Cadenero::User.count.should == 0
24
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.a1
4
+ version: 0.0.2.a2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: