spec/localeapp/cli/install_spec.rb in localeapp-0.4.0 vs spec/localeapp/cli/install_spec.rb in localeapp-0.4.1
- old
+ new
@@ -37,6 +37,28 @@
it "asks the default configuration to write itself" do
@command.stub!(:check_key).and_return([true, valid_project_data])
@command.should_receive(:write_configuration_file).with('config/initializers/localeapp.rb')
@command.execute('API_KEY', @output)
end
+
+ it "asks the configuration to write itself to .localeapp when the --standalone switch is set" do
+ @command.stub!(:check_key).and_return([true, valid_project_data])
+ @command.config_type = :standalone
+ @command.should_receive(:write_configuration_file).with('.localeapp/config.rb')
+ @command.execute('API_KEY', @output)
+ end
+
+ it "displays warning if config.translation_data_directory doesn't exist" do
+ @command.stub!(:check_key).and_return([true, valid_project_data])
+ @command.stub!(:write_configuration_file)
+ @command.execute('API_KEY', @output)
+ @output.string.should match(/Your translation data will be stored there./)
+ end
+
+ it "doesn't display a warning if translation_data_directory exists" do
+ @command.stub!(:check_key).and_return([true, valid_project_data])
+ @command.stub!(:write_configuration_file)
+ File.should_receive(:directory?).and_return(true)
+ @command.execute('API_KEY', @output)
+ @output.string.should_not match(/Your translation data will be stored there./)
+ end
end