spec/flydata/command/base_spec.rb in flydata-0.3.13 vs spec/flydata/command/base_spec.rb in flydata-0.3.14
- old
+ new
@@ -5,17 +5,19 @@
module Command
describe Base do
subject { described_class.new }
let(:data_entries) {
-[{"id"=>4, "data_port_id"=>1, "name"=>"flydata_sync_mysql_2", "log_path"=>nil, "created_at"=>"2015-03-02T03:06:25.000Z", "updated_at"=>"2015-03-02T03:08:02.000Z", "log_deletion"=>nil, "display_name"=>"synctest", "heroku_resource_id"=>nil, "heroku_log_type"=>nil, "log_file_type"=>nil, "log_file_delimiter"=>nil, "enabled"=>true, "type"=>"RedshiftMysqlDataEntry", "tag_name"=>"flydata.c5c0eb3d_dp1.flydata_sync_mysql_2", "tag_name_dev"=>"flydata.c5c0eb3d_dp1.flydata_sync_mysql_2.dev", "data_port_key"=>"c5c0eb3d", "schema_name"=>"", "table_name"=>"", "redshift_schema_name"=>"", "redshift_table_name"=>"", "mysql_data_entry_preference"=>{"host"=>"ubertas.flydata.co", "port"=>3306, "username"=>"mak", "password"=>password, "database"=>"mak_development", "tables"=>"items,orders", "tables_append_only"=>""}}]
+[{"id"=>4, "data_port_id"=>1, "name"=>"flydata_sync_mysql_2", "log_path"=>nil, "created_at"=>"2015-03-02T03:06:25.000Z", "updated_at"=>"2015-03-02T03:08:02.000Z", "log_deletion"=>nil, "display_name"=>"synctest", "heroku_resource_id"=>nil, "heroku_log_type"=>nil, "log_file_type"=>nil, "log_file_delimiter"=>nil, "enabled"=>true, "type"=>"RedshiftMysqlDataEntry", "tag_name"=>"flydata.c5c0eb3d_dp1.flydata_sync_mysql_2", "tag_name_dev"=>"flydata.c5c0eb3d_dp1.flydata_sync_mysql_2.dev", "data_port_key"=>"c5c0eb3d", "purpose_name" => "Test app", "schema_name"=>"", "table_name"=>"", "redshift_schema_name"=>"", "redshift_table_name"=>"", "mysql_data_entry_preference"=>{"host"=>"ubertas.flydata.co", "port"=>3306, "username"=>"mak", "password"=>password, "database"=>"mak_development", "tables"=>"items,orders", "tables_append_only"=>""}}]
}
let(:flydata) { double('flydata') }
let(:path) { '/data_entries' }
let(:response_body) { data_entries }
let(:response) { double('response') }
let(:response_code) { 200 }
+ let(:password) { '' }
+
before do
allow(response).to receive(:code).and_return(response_code)
allow(flydata).to receive(:get).with(path).and_return(response_body)
allow(flydata).to receive(:response).and_return(response)
allow(subject).to receive(:flydata).and_return(flydata)
@@ -35,10 +37,15 @@
expect(subject.retrieve_data_entries).to eq(data_entries)
end
end
end
+ describe "#show_purpose_name" do
+ it "calls log_info_stdout with appropriate message" do
+ expect(subject).to receive(:log_info_stdout).with("Your current application name is 'Test app'")
+ subject.show_purpose_name
+ end
+ end
end
end
end
-